mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-23 05:36:12 +00:00
Fix gemini when tools are null (#1992)
This commit is contained in:
@@ -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;
|
||||
})
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user