We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 452e0b7 commit 0eae311Copy full SHA for 0eae311
src/backend/src/modules/puterai/lib/FunctionCalling.js
@@ -121,14 +121,17 @@ module.exports = class FunctionCalling {
121
}
122
123
static make_gemini_tools (tools) {
124
- return [
125
- {
126
- function_declarations: tools.map(t => {
127
- const tool = t.function;
128
- delete tool.parameters.additionalProperties;
129
- return tool;
130
- })
131
- }
132
- ];
+ if (Array.isArray(tools)) {
+ return [
+ {
+ function_declarations: tools.map(t => {
+ const tool = t.function;
+ delete tool.parameters.additionalProperties;
+ return tool;
+ })
+ }
133
+ ];
134
+ };
135
+
136
137
0 commit comments