export type GetApiAnthropicV1MessagesBatchesBatchIdResultsArgs = {batch_id: string, 'x-model-provider'?: string | undefined}; export type GetApiAnthropicV1MessagesBatchesBatchIdResultsOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get batch results (Anthropic format) * * GET /anthropic/v1/messages/batches/{batch_id}/results * * Also accepts auth: BasicAuth, VirtualKeyAuth, ApiKeyAuth */ export const getApiAnthropicV1MessagesBatchesBatchIdResults = async (args: GetApiAnthropicV1MessagesBatchesBatchIdResultsArgs, options?: GetApiAnthropicV1MessagesBatchesBatchIdResultsOptions) => { const {baseUrl = "http://localhost:8080", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/x-ndjson") if (args['x-model-provider'] != null) headers.set("x-model-provider", String(args['x-model-provider'])) if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/anthropic/v1/messages/batches/${encodeURIComponent(String(args.batch_id))}/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 res.blob() };