export type PatchApiV1EvalsIdArgs = {id: string, body: {name?: string | undefined, description?: string | undefined}}; export type PatchApiV1EvalsIdOptions = {baseUrl?: string | undefined, ProjectPrivateApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an evaluation * * PATCH /v1/evals/{id} */ export const patchApiV1EvalsId = async (args: PatchApiV1EvalsIdArgs, options?: PatchApiV1EvalsIdOptions) => { const {baseUrl = "https://api.lunary.ai", fetch: fetchFn = fetch, ProjectPrivateApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ProjectPrivateApiKeyAuth !== undefined) headers.set('authorization', `Bearer ${ProjectPrivateApiKeyAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/evals/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };