From dcc1a4ebd6f51311e422e95e59539fba6da9f751 Mon Sep 17 00:00:00 2001 From: misaka20002 <40714502+misaka20002@users.noreply.github.com> Date: Fri, 7 Feb 2025 22:14:09 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=E4=BC=AA=E4=BA=BA=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E7=BE=A4=20(#758)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/bym.js | 6 ++++++ guoba.support.js | 15 +++++++++++++-- utils/config.js | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/apps/bym.js b/apps/bym.js index 12243a9..25f2cdc 100644 --- a/apps/bym.js +++ b/apps/bym.js @@ -28,6 +28,12 @@ export class bym extends plugin { if (!Config.enableBYM) { return false } + + // 伪人禁用群 + if (Config.bymDisableGroup?.includes(e.group_id?.toString())) { + return false + } + let sender = e.sender.user_id let card = e.sender.card || e.sender.nickname let group = e.group_id diff --git a/guoba.support.js b/guoba.support.js index fdf6b95..c255ab0 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -54,7 +54,7 @@ export function supportGuoba () { { field: 'enableBYM', label: '开启伪人模式', - bottomHelpMessage: '开启后,将在群内随机发言,伪装成人。取消机器人前缀体验最佳。目前仅支持gemini,会使用gemini的配置。发言包括AI名字会必定触发回复。暂不支持分群管理,可在不同群禁用或启动“ChatGPT-Plugin 伪人bym”功能', + bottomHelpMessage: '开启后,将在群内随机发言,伪装成人。取消机器人前缀体验最佳。目前仅支持gemini,会使用gemini的配置。发言包括AI名字会必定触发回复。', component: 'Switch' }, { @@ -918,7 +918,6 @@ export function supportGuoba () { label: '合成emoji的API地址,默认谷歌厨房', component: 'Input' }, - { field: 'bymRate', label: '伪人模式触发概率,单位为%', @@ -928,6 +927,18 @@ export function supportGuoba () { max: 100 } }, + { + field: 'bymDisableGroup', + label: '伪人禁用群', + bottomHelpMessage: '设置在该群禁用伪人模式', + component: "GTags", + componentProps: { + placeholder: '请输入群号', + allowAdd: true, + allowDel: true, + valueParser: ((value) => value.split(',') || []), + }, + }, { field: 'bymMode', label: '伪人模型', diff --git a/utils/config.js b/utils/config.js index 1e447e1..44e23ce 100644 --- a/utils/config.js +++ b/utils/config.js @@ -199,6 +199,7 @@ const defaultConfig = { enableBYM: false, // 触发对话的概率,百分比。比如5%就写5 bymRate: 5, + bymDisableGroup: [], // 伪人模式触发骂人反击的关键词 bymFuckList: [ '骂', From 8249acaf08fe2e71645d53ae18c93aefb712c3bb Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Mon, 10 Feb 2025 17:11:41 +0800 Subject: [PATCH 2/5] fix: max token --- guoba.support.js | 12 +++++++++--- model/core.js | 3 ++- utils/config.js | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/guoba.support.js b/guoba.support.js index c255ab0..a219131 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -142,9 +142,15 @@ export function supportGuoba () { { field: 'model', label: 'OpenAI 模型', - bottomHelpMessage: 'gpt-4, gpt-4-0613, gpt-4-1106, gpt-4-32k, gpt-4-32k-0613, gpt-3.5-turbo, gpt-3.5-turbo-0613, gpt-3.5-turbo-1106, gpt-3.5-turbo-16k-0613。默认为gpt-3.5-turbo,gpt-4需账户支持', + bottomHelpMessage: '填写OpenAI模型或OpenAI API兼容的其他模型。', component: 'Input' }, + { + field: 'apiMaxToken', + label: 'max token', + bottomHelpMessage: '默认4096', + component: 'InputNumber' + }, { field: 'smartMode', label: '智能模式', @@ -154,13 +160,13 @@ export function supportGuoba () { { field: 'forwardReasoning', label: '是否转发思考过程', - bottomHelpMessage: 'OpenAI的o系列、deepseek的r系列等思考模型的思考过程是否以转发形式发出。默认开启', + bottomHelpMessage: 'OpenAI的o系列、deepseek的r系列等思考模型的思考过程是否以转发形式发出。仅适配reasoning_content。默认开启。', component: 'Switch' }, { field: 'openAiBaseUrl', label: 'OpenAI API服务器地址', - bottomHelpMessage: 'OpenAI的API服务器地址。注意要带上/v1。默认为https://api.openai.com/v1', + bottomHelpMessage: 'OpenAI兼容API服务器地址。注意要带上/v1。默认为https://api.openai.com/v1', component: 'Input' }, { diff --git a/model/core.js b/model/core.js index 7139787..2d906f1 100644 --- a/model/core.js +++ b/model/core.js @@ -646,7 +646,8 @@ class Core { completionParams, assistantLabel: Config.assistantLabel, fetch: newFetch, - maxModelTokens + maxModelTokens, + maxResponseTokens: Config.apiMaxToken } let openAIAccessible = (Config.proxy || !(await isCN())) // 配了代理或者服务器在国外,默认认为不需要反代 if (opts.apiBaseUrl !== defaultOpenAIAPI && openAIAccessible && !Config.openAiForceUseReverse) { diff --git a/utils/config.js b/utils/config.js index 44e23ce..3dfde16 100644 --- a/utils/config.js +++ b/utils/config.js @@ -226,7 +226,7 @@ const defaultConfig = { bingAiOid: '', _2captchaKey: '', bingReasoning: false, // 是否深度思考 - + apiMaxToken: 4096, version: 'v2.8.3' } const _path = process.cwd() From d957025fa8be3779643e12fdc8d6ce1b8fddd1ca Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Mon, 10 Feb 2025 17:15:48 +0800 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20=E7=9C=8B=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/management.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/management.js b/apps/management.js index f25163c..b9c8add 100644 --- a/apps/management.js +++ b/apps/management.js @@ -1810,12 +1810,24 @@ azure语音:Azure 语音是微软 Azure 平台提供的一项语音服务, let config = [] config.push(`当前模式:${use}`) config.push(`\n当前API模型:${Config.model}`) + config.push(`\n当前开启API流式输出:${Config.apiStream}`) + config.push(`\n当前开启BYM模式:${Config.enableBYM}`) + config.push(`\n当前BYM模式:${Config.bymMode}`) + config.push(`\n当前智能模式:${Config.smartMode}`) if (e.isPrivate) { config.push(`\n当前APIKey:${Config.apiKey}`) config.push(`\n当前API反代:${Config.openAiBaseUrl}`) config.push(`\n当前必应反代:${Config.sydneyReverseProxy}`) + config.push(`\n当前Gemini API Key:${Config.geminiKey}`) + config.push(`\n当前Gemini反代:${Config.geminiBaseUrl}`) + config.push(`\n当前Claude API 反代:${Config.claudeApiBaseUrl}`) + config.push(`\n当前Claude API Key:${Config.claudeApiKey}`) + config.push(`\n当前开启工具箱:${Config.enableToolbox}`) } config.push(`\n当前星火模型:${Config.xhmode}`) + config.push(`\n当前Claude模型:${Config.claudeApiModel}`) + config.push(`\n当前Gemini模型:${Config.geminiKey}`) + config.push(`\n当前Qwen模型:${Config.qwenModel}`) this.reply(config) } From b95bacc7e8374e020d1184bcf1e34664c3fd10e6 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Mon, 10 Feb 2025 17:19:14 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=E7=9C=8B=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/management.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/management.js b/apps/management.js index b9c8add..1e2371e 100644 --- a/apps/management.js +++ b/apps/management.js @@ -1826,7 +1826,7 @@ azure语音:Azure 语音是微软 Azure 平台提供的一项语音服务, } config.push(`\n当前星火模型:${Config.xhmode}`) config.push(`\n当前Claude模型:${Config.claudeApiModel}`) - config.push(`\n当前Gemini模型:${Config.geminiKey}`) + config.push(`\n当前Gemini模型:${Config.geminiModel}`) config.push(`\n当前Qwen模型:${Config.qwenModel}`) this.reply(config) } From 6d9c842a8fca1a813230f20b557d82650e577098 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Tue, 11 Feb 2025 23:16:51 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20bym=E4=B9=9F=E8=B5=B0=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E6=A8=A1=E5=BC=8F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/bym.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/bym.js b/apps/bym.js index 25f2cdc..bbe0bd7 100644 --- a/apps/bym.js +++ b/apps/bym.js @@ -66,7 +66,7 @@ export class bym extends plugin { `\n你的回复应该尽可能简练,像人类一样随意,不要附加任何奇怪的东西,如聊天记录的格式(比如${Config.assistantLabel}:),禁止重复聊天记录。` let rsp = await core.sendMessage(e.msg, {}, Config.bymMode, e, { - enableSmart: true, + enableSmart: Config.smartMode, system: { api: system, qwen: system,