fixed google s2s mcp initiate wrong functionDeclarations (#1203)

* fixed google s2s mcp initiate wrong functionDeclarations

* populate model from llm verb to google setup message
This commit is contained in:
Hoan Luu Huu
2025-05-19 07:15:26 +07:00
committed by GitHub
parent 761b7f26e7
commit b92a9c700e

View File

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