mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
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:
@@ -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) => {
|
||||
const convertedTools = [
|
||||
{
|
||||
functionDeclarations: mcpTools.map((tool) => {
|
||||
if (tool.inputSchema) {
|
||||
delete tool.inputSchema.additionalProperties;
|
||||
delete tool.inputSchema['$schema'];
|
||||
}
|
||||
return {
|
||||
functionDeclarations: {
|
||||
name: tool.name,
|
||||
description: tool.description,
|
||||
parameters: tool.inputSchema,
|
||||
}
|
||||
};
|
||||
})
|
||||
}
|
||||
);
|
||||
];
|
||||
// merge with any existing tools
|
||||
setup.tools = [...convertedTools, ...(this.setup.tools || [])];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user