/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { llmSpeechSpeak } from "../../funcs/llmSpeechSpeak.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.TextToSpeechRequest$inboundSchema, }; export const tool$llmSpeechSpeak: ToolDefinition = { name: "llm-speech-speak", description: `Text to speech Convert text to speech with automatic language detection. **Request Body:** - \`text\`: Input text to convert to speech - required - \`language\`: Language code (default: "auto") - "auto" for automatic detection, or ISO 639-1 codes: en, zh, hi, es, ar, bn, pt, ru, ja, pa, de, ko, fr, tr, it, th, pl, nl, id, vi, ur - \`model\`: TTS model identifier (default: "auto") - "auto" selects the default provider; a registry-resolvable id dispatches to the matching provider **Response:** Returns audio file in WAV format with X-Language-Code header. When \`store\` is \`true\`, the generation is persisted before the response returns and the new history record id is included in the X-Tts-Id header.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await llmSpeechSpeak( 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.result; return formatResult(value, apiCall); }, };