fix: 修复前几天支持multiple tools导致的gemini搜了不发的问题

This commit is contained in:
ikechan8370 2025-02-16 20:59:26 +08:00
parent 213818b635
commit fcca28de37
2 changed files with 6 additions and 5 deletions

View file

@ -222,11 +222,11 @@ export class CustomGoogleGeminiClient extends GoogleGeminiClient {
// ANY要笑死人的效果
let mode = opt.toolMode || 'AUTO'
let lastFuncName = opt.functionResponse?.name
let lastFuncName = (/** @type {FunctionResponse[] | undefined}**/ opt.functionResponse)?.map(rsp => rsp.name)
const mustSendNextTurn = [
'searchImage', 'searchMusic', 'searchVideo'
]
if (lastFuncName && mustSendNextTurn.includes(lastFuncName)) {
if (lastFuncName && lastFuncName?.find(name => mustSendNextTurn.includes(name))) {
mode = 'ANY'
}
body.tool_config = {