export type CreateApiModelsModelIdEndpointsModelEndpointIdAlertArgs = {model_id: number, model_endpoint_id: string, body: BodyInit}; export type CreateApiModelsModelIdEndpointsModelEndpointIdAlertOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Creates alert for given model endpoint. * * POST /models/{model_id}/endpoints/{model_endpoint_id}/alert */ export const createApiModelsModelIdEndpointsModelEndpointIdAlert = async (args: CreateApiModelsModelIdEndpointsModelEndpointIdAlertArgs, options?: CreateApiModelsModelIdEndpointsModelEndpointIdAlertOptions) => { const {baseUrl = "http://localhost:8080/v1", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "*/*") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/models/${encodeURIComponent(String(args.model_id))}/endpoints/${encodeURIComponent(String(args.model_endpoint_id))}/alert${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };