mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
commit
d41ceec7da
4 changed files with 26 additions and 1 deletions
|
|
@ -245,6 +245,8 @@ export class CustomGoogleGeminiClient extends GoogleGeminiClient {
|
||||||
if (lastFuncName && lastFuncName?.find(name => mustSendNextTurn.includes(name))) {
|
if (lastFuncName && lastFuncName?.find(name => mustSendNextTurn.includes(name))) {
|
||||||
mode = 'ANY'
|
mode = 'ANY'
|
||||||
}
|
}
|
||||||
|
// 防止死循环。
|
||||||
|
delete opt.toolMode
|
||||||
body.tool_config = {
|
body.tool_config = {
|
||||||
function_calling_config: {
|
function_calling_config: {
|
||||||
mode
|
mode
|
||||||
|
|
|
||||||
|
|
@ -557,6 +557,26 @@ export function supportGuoba () {
|
||||||
bottomHelpMessage: '对https://generativelanguage.googleapis.com的反代',
|
bottomHelpMessage: '对https://generativelanguage.googleapis.com的反代',
|
||||||
component: 'Input'
|
component: 'Input'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'geminiForceToolKeywords',
|
||||||
|
label: 'gemini强制工具关键词',
|
||||||
|
bottomHelpMessage: 'gemini强制工具关键词,包含这里关键词的问题一定会调用工具。',
|
||||||
|
component: 'GTags',
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入强制工具关键词',
|
||||||
|
allowAdd: true,
|
||||||
|
allowDel: true,
|
||||||
|
showPrompt: true,
|
||||||
|
promptProps: {
|
||||||
|
content: '添加新的强制工具关键词',
|
||||||
|
okText: '添加',
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: '强制工具关键词不能为空' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
valueParser: (value) => value.split(',') || []
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '以下为一些杂项配置。',
|
label: '以下为一些杂项配置。',
|
||||||
component: 'Divider'
|
component: 'Divider'
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,8 @@ class Core {
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
replyPureTextCallback: undefined,
|
replyPureTextCallback: undefined,
|
||||||
enableGroupContext: Config.enableGroupContext
|
enableGroupContext: Config.enableGroupContext,
|
||||||
|
forceTool: false
|
||||||
}
|
}
|
||||||
}) {
|
}) {
|
||||||
if (!conversation) {
|
if (!conversation) {
|
||||||
|
|
@ -567,6 +568,7 @@ class Core {
|
||||||
await e.reply(msg, true)
|
await e.reply(msg, true)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
option.toolMode = (opt.settings.forceTool || Config.geminiForceToolKeywords?.find(k => prompt.includes(k))) ? 'ANY' : 'AUTO'
|
||||||
return await client.sendMessage(prompt, option)
|
return await client.sendMessage(prompt, option)
|
||||||
} else if (use === 'chatglm4') {
|
} else if (use === 'chatglm4') {
|
||||||
const client = new ChatGLM4Client({
|
const client = new ChatGLM4Client({
|
||||||
|
|
|
||||||
|
|
@ -228,6 +228,7 @@ const defaultConfig = {
|
||||||
bingReasoning: false, // 是否深度思考
|
bingReasoning: false, // 是否深度思考
|
||||||
apiMaxToken: 4096,
|
apiMaxToken: 4096,
|
||||||
enableToolPrivateSend: true, // 是否允许智能模式下私聊骚扰其他群友。主人不受影响。
|
enableToolPrivateSend: true, // 是否允许智能模式下私聊骚扰其他群友。主人不受影响。
|
||||||
|
geminiForceToolKeywords: [],
|
||||||
version: 'v2.8.4'
|
version: 'v2.8.4'
|
||||||
}
|
}
|
||||||
const _path = process.cwd()
|
const _path = process.cwd()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue