import { L as LangVoiceClient } from '../client-pNrzz2-q.mjs'; import { AutoGenFunctionDef, AutoGenFunctionCall, TTSInput, TTSResult, MultiVoiceInput } from './types.mjs'; /** * AutoGen tools for LangVoice TTS * * Provides integration with Microsoft AutoGen framework for multi-agent systems. * * @example * ```typescript * import { LangVoiceAutoGenTools } from 'langvoice-sdk/tools'; * * const tools = new LangVoiceAutoGenTools({ apiKey: 'your-api-key' }); * * // Get function definitions for AutoGen agent * const functionDefs = tools.getFunctionDefinitions(); * * // Register with AutoGen agent * const functionMap = tools.getFunctionMap(); * ``` */ interface AutoGenToolOptions { /** LangVoice API key */ apiKey?: string; /** Default output file path for audio */ outputFile?: string; /** Whether to automatically save audio files */ autoSave?: boolean; } type FunctionHandler = (args: Record) => Promise; interface FunctionMap { [key: string]: FunctionHandler; } /** * AutoGen integration for LangVoice TTS * * Provides function definitions and handlers compatible with Microsoft AutoGen * multi-agent framework. * * @example * ```typescript * import { LangVoiceAutoGenTools } from 'langvoice-sdk/tools'; * * const langvoiceTools = new LangVoiceAutoGenTools({ * apiKey: 'your-api-key', * autoSave: true, * outputFile: 'speech.mp3', * }); * * // Get function definitions for the agent config * const functions = langvoiceTools.getFunctionDefinitions(); * * // Get the function map for registration * const functionMap = langvoiceTools.getFunctionMap(); * * // Or handle calls manually * const result = await langvoiceTools.handleFunctionCall({ * name: 'langvoice_text_to_speech', * arguments: { text: 'Hello world!' }, * }); * ``` */ declare class LangVoiceAutoGenTools { private readonly client; private readonly outputFile; private readonly autoSave; constructor(options?: AutoGenToolOptions); /** * Get the underlying LangVoice client */ getClient(): LangVoiceClient; /** * Get all function definitions for AutoGen agent configuration */ getFunctionDefinitions(): AutoGenFunctionDef[]; /** * Get function definition by name */ getFunctionDefinition(name: string): AutoGenFunctionDef | undefined; /** * Get the TTS function definition only */ getTTSFunctionDef(): AutoGenFunctionDef; /** * Get the multi-voice function definition only */ getMultiVoiceFunctionDef(): AutoGenFunctionDef; /** * Get a map of function names to handlers * * Use this to register functions with AutoGen agents: * ```typescript * const functionMap = tools.getFunctionMap(); * // Register with AutoGen agent * ``` */ getFunctionMap(): FunctionMap; /** * Handle text-to-speech function call */ private textToSpeechHandler; /** * Handle multi-voice function call */ private multiVoiceHandler; /** * Handle list voices function call */ private listVoicesHandler; /** * Handle list languages function call */ private listLanguagesHandler; /** * Handle a function call from AutoGen * * @param call - The function call object * @returns JSON string result */ handleFunctionCall(call: AutoGenFunctionCall): Promise; /** * Generate speech directly (not as a tool call) */ generateSpeech(input: TTSInput): Promise; /** * Generate multi-voice speech directly */ generateMultiVoice(input: MultiVoiceInput): Promise; /** * Save audio result to file */ saveAudio(result: TTSResult, outputPath?: string): Promise; } /** * Create LangVoice AutoGen tools instance */ declare function createAutoGenTools(options?: AutoGenToolOptions): LangVoiceAutoGenTools; /** * Get function definitions for AutoGen (without creating full tools instance) */ declare function getAutoGenFunctionDefinitions(): AutoGenFunctionDef[]; export { type AutoGenToolOptions, type FunctionHandler, type FunctionMap, LangVoiceAutoGenTools, createAutoGenTools, getAutoGenFunctionDefinitions };