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 = {
|
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 || [])];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user