diff --git a/lib/tasks/llm/llms/google_s2s.js b/lib/tasks/llm/llms/google_s2s.js index dcf3349a..a2aace3f 100644 --- a/lib/tasks/llm/llms/google_s2s.js +++ b/lib/tasks/llm/llms/google_s2s.js @@ -53,6 +53,7 @@ class TaskLlmGoogle_S2S extends Task { } this.setup = { ...setup, + model: this.model, // make sure output is always audio generationConfig: { ...(setup.generationConfig || {}), @@ -161,16 +162,21 @@ class TaskLlmGoogle_S2S extends Task { const setup = this.setup; const mcpTools = this.parent.isMcpEnabled ? await this.parent.mcpService.getAvailableMcpTools() : []; if (mcpTools && mcpTools.length > 0) { - const convertedTools = mcpTools.map((tool) => { - return { - functionDeclarations: { - name: tool.name, - description: tool.description, - parameters: tool.inputSchema, - } - }; - } - ); + const convertedTools = [ + { + functionDeclarations: mcpTools.map((tool) => { + if (tool.inputSchema) { + delete tool.inputSchema.additionalProperties; + delete tool.inputSchema['$schema']; + } + return { + name: tool.name, + description: tool.description, + parameters: tool.inputSchema, + }; + }) + } + ]; // merge with any existing tools setup.tools = [...convertedTools, ...(this.setup.tools || [])]; }