fix: 死循环

This commit is contained in:
ikechan8370 2025-02-17 02:23:50 +08:00
parent 3b58397a16
commit 95e776b334
2 changed files with 3 additions and 1 deletions

View file

@ -229,6 +229,8 @@ export class CustomGoogleGeminiClient extends GoogleGeminiClient {
if (lastFuncName && lastFuncName?.find(name => mustSendNextTurn.includes(name))) {
mode = 'ANY'
}
// 防止死循环。
delete opt.toolMode
body.tool_config = {
function_calling_config: {
mode

View file

@ -568,7 +568,7 @@ class Core {
await e.reply(msg, true)
}
})
option.toolMode = opt.settings.forceTool ? 'ANY' : 'AUTO'
option.toolMode = (opt.settings.forceTool || Config.geminiForceToolKeywords?.find(k => prompt.includes(k))) ? 'ANY' : 'AUTO'
return await client.sendMessage(prompt, option)
} else if (use === 'chatglm4') {
const client = new ChatGLM4Client({