export type GetApiV1EvalsEvalIdResultsArgs = {evalId: string}; export type GetApiV1EvalsEvalIdResultsOptions = {baseUrl?: string | undefined, ProjectPrivateApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * List results for an evaluation * * GET /v1/evals/{evalId}/results */ export const getApiV1EvalsEvalIdResults = async (args: GetApiV1EvalsEvalIdResultsArgs, options?: GetApiV1EvalsEvalIdResultsOptions) => { 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.evalId))}/results${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 };