Support non-function native tools for Gemini * Enable retrieval tool type for VertexAI Gemini endpoints * Apply code suggestion --------- Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Signed| @@ -436,9 +436,13 @@ async function sendMakerSuiteRequest(request, response) { | ||
| 436 | 436 | delete tool.function.parameters; |
| 437 | 437 | } |
| 438 | 438 | functionDeclarations.push(tool.function); |
| 439 | + } else if (tool[tool.type]) { | |
| 440 | + tools.push({ [tool.type]: tool[tool.type] }); | |
| 439 | 441 | } |
| 440 | 442 | } |
| 441 | - tools.push({ function_declarations: functionDeclarations }); | |
| 443 | + if (functionDeclarations.length > 0) { | |
| 444 | + tools.push({ function_declarations: functionDeclarations }); | |
| 445 | + } | |
| 442 | 446 | } |
| 443 | 447 | |
| 444 | 448 | if (isThinkingConfigModel(model)) { |