/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { llmSpeechTranscribe } from "../../funcs/llmSpeechTranscribe.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.TranscribeRequest$inboundSchema, }; export const tool$llmSpeechTranscribe: ToolDefinition = { name: "llm-speech-transcribe", description: `Speech to text transcription Convert audio to text using advanced speech recognition. **Complete File Upload (Standard)** Use \`Content-Type: multipart/form-data\` to upload the complete audio file in one request. Maximum file size: 25MB. Example: \`\`\`bash curl -X POST "http://localhost:3000/api/v1/llm/speech/transcriptions?language=en" \ -F "file=@audio.flac" \`\`\` **Chunked Upload (Streaming)** Use \`Transfer-Encoding: chunked\` header to stream audio data in chunks as it's being recorded. No need to know total file size upfront. Server buffers chunks until complete before processing. Maximum total size: 25MB. Example: \`\`\`bash curl -X POST "http://localhost:3000/api/v1/llm/speech/transcriptions?language=en" \ -H "Transfer-Encoding: chunked" \ -H "Content-Type: multipart/form-data" \ --data-binary @audio.flac \`\`\` **Supported Formats:** FLAC, MP3, MP4, MPEG, MPGA, M4A, OGG, WAV, WebM **Query Parameters:** - \`model\` (optional): Transcription model identifier. Defaults to 'auto'. - \`language\` (optional): ISO-639-1 or BCP-47 language code (e.g., "en", "en-US"). Auto-detects if not specified. - \`prompt\` (optional): Legacy prompt parameter retained for backward compatibility. - \`temperature\` (optional): Legacy temperature parameter retained for backward compatibility. - \`include_speaker_data\` (optional): When \`true\`, include speaker diarization data and require WAV/PCM input. Otherwise transcription uses the standard compatibility path. **Response:** Returns transcribed text in JSON format.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await llmSpeechTranscribe( 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); }, };