Skip to content

Commit

Permalink
fix: gemini tool optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ikechan8370 committed Nov 18, 2024
1 parent 7c2961c commit 30f9c82
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions client/CustomGoogleGeminiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,20 @@ export class CustomGoogleGeminiClient extends GoogleGeminiClient {
temperature: opt.temperature || 0.9,
topP: opt.topP || 0.95,
topK: opt.tokK || 16
},
tools: [
}
}
if (this.tools?.length > 0) {
body.tools = [
{
functionDeclarations: this.tools.map(tool => tool.function())
function_declarations: this.tools.map(tool => tool.function())
// codeExecution: {}
}
]
body.tool_config = {
function_calling_config: {
mode: 'ANY'
}
}
}
if (opt.image) {
delete body.tools
Expand Down

0 comments on commit 30f9c82

Please sign in to comment.