Fix gemini when tools are null (#1992)

This commit is contained in:
Neal Shah
2025-11-21 01:57:39 +04:00
committed by GitHub
parent 452e0b7001
commit b035fda778
@@ -121,14 +121,17 @@ module.exports = class FunctionCalling {
}
static make_gemini_tools (tools) {
return [
{
function_declarations: tools.map(t => {
const tool = t.function;
delete tool.parameters.additionalProperties;
return tool;
})
}
];
if (Array.isArray(tools)) {
return [
{
function_declarations: tools.map(t => {
const tool = t.function;
delete tool.parameters.additionalProperties;
return tool;
})
}
];
};
}
}