mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +00:00
Update bym.js (#735)
* feat: new bing (WIP) * fix: update CopilotAIClient.js * fix: gemini强制调用tool;real at * feat: add bym support
This commit is contained in:
parent
5f6c4e5abb
commit
26444df2a2
9 changed files with 599 additions and 30 deletions
|
|
@ -105,6 +105,7 @@ export class CustomGoogleGeminiClient extends GoogleGeminiClient {
|
|||
* topP: number?,
|
||||
* tokK: number?,
|
||||
* replyPureTextCallback: Function,
|
||||
* toolMode: 'AUTO' | 'ANY' | 'NONE'
|
||||
* search: boolean,
|
||||
* codeExecution: boolean
|
||||
* }} opt
|
||||
|
|
@ -199,9 +200,17 @@ export class CustomGoogleGeminiClient extends GoogleGeminiClient {
|
|||
})
|
||||
|
||||
// ANY要笑死人的效果
|
||||
let mode = opt.toolMode || 'AUTO'
|
||||
let lastFuncName = opt.functionResponse?.name
|
||||
const mustSendNextTurn = [
|
||||
'searchImage', 'searchMusic', 'searchVideo'
|
||||
]
|
||||
if (lastFuncName && mustSendNextTurn.includes(lastFuncName)) {
|
||||
mode = 'ANY'
|
||||
}
|
||||
body.tool_config = {
|
||||
function_calling_config: {
|
||||
mode: 'AUTO'
|
||||
mode
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -248,6 +257,7 @@ export class CustomGoogleGeminiClient extends GoogleGeminiClient {
|
|||
const text = responseContent.parts.find(i => i.text)?.text
|
||||
if (text) {
|
||||
// send reply first
|
||||
logger.info('send message: ' + text)
|
||||
opt.replyPureTextCallback && await opt.replyPureTextCallback(text)
|
||||
}
|
||||
// Gemini有时候只回复一个空的functionCall,无语死了
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue