/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { llmEvalsGetSampleAudio } from "../../funcs/llmEvalsGetSampleAudio.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.GetEvalSampleAudioRequest$inboundSchema, }; export const tool$llmEvalsGetSampleAudio: ToolDefinition = { name: "llm-evals-get-sample-audio", description: `Get eval sample audio Returns \`{ object, audio, sample_index, task_id, model }\` for a single transcription sample — the clip reference (a base64 \`data:\` URI or a URL) read from the un-redacted \`dataset_row\` (list responses redact inline \`data:\` blobs), plus the resolved task/model. Prefers the task's configured \`audio_column\`, falling back to a heuristic scan. The clip differs across tasks, so pass \`task_id\` when a run has more than one transcription task; if the index spans multiple tasks and \`task_id\` is omitted, returns 400 rather than guessing. \`model\` is optional (the clip is identical across models) and only extends the index prefix. Returns 404 when the sample or its audio is absent, 413 when the inline clip is too large. Returns 503 when object storage is briefly unreachable, as distinct from 404 for a clip that is genuinely gone.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await llmEvalsGetSampleAudio( client, args.request, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } const value = result.value; return formatResult(value, apiCall); }, };