mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +00:00
fix: gemini tool optional
This commit is contained in:
parent
7c2961cdcd
commit
30f9c82d73
1 changed files with 10 additions and 3 deletions
|
|
@ -163,13 +163,20 @@ export class CustomGoogleGeminiClient extends GoogleGeminiClient {
|
||||||
temperature: opt.temperature || 0.9,
|
temperature: opt.temperature || 0.9,
|
||||||
topP: opt.topP || 0.95,
|
topP: opt.topP || 0.95,
|
||||||
topK: opt.tokK || 16
|
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: {}
|
// codeExecution: {}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
body.tool_config = {
|
||||||
|
function_calling_config: {
|
||||||
|
mode: 'ANY'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (opt.image) {
|
if (opt.image) {
|
||||||
delete body.tools
|
delete body.tools
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue