export type GetApiV1EvalsIdArgs = {id: string}; export type GetApiV1EvalsIdOptions = {baseUrl?: string | undefined, ProjectPrivateApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get evaluation by ID * * GET /v1/evals/{id} */ export const getApiV1EvalsId = async (args: GetApiV1EvalsIdArgs, options?: GetApiV1EvalsIdOptions) => { const {baseUrl = "https://api.lunary.ai", fetch: fetchFn = fetch, ProjectPrivateApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() 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: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };