export type JudgeClassificationOutputOption = {value: string, description: string}; export type JudgeClassificationOutput = {type?: 'CLASSIFICATION' | undefined, options: Array}; export type JudgeRegressionOutput = {type?: 'REGRESSION' | undefined, min?: number | undefined, min_description: string, max?: number | undefined, max_description: string}; export type UpdateJudgeRequest = {name: string, description: string, model_name: string, output: JudgeClassificationOutput | JudgeRegressionOutput, instructions: string, tools: Array}; export type UpdateApiV1ObservabilityJudgesJudgeIdArgs = {judge_id: string, body: UpdateJudgeRequest}; export type UpdateApiV1ObservabilityJudgesJudgeIdOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a judge * * PUT /v1/observability/judges/{judge_id} */ export const updateApiV1ObservabilityJudgesJudgeId = async (args: UpdateApiV1ObservabilityJudgesJudgeIdArgs, options?: UpdateApiV1ObservabilityJudgesJudgeIdOptions) => { const {baseUrl = "https://api.mistral.ai", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKey !== undefined) headers.set('authorization', `Bearer ${ApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/observability/judges/${encodeURIComponent(String(args.judge_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };