From 758aeb67a281b82d0377791e1035da56c8bcf153 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Sun, 21 May 2023 18:54:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BC=80=E5=90=AF=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BC=9A=E7=88=86token=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/management.js | 1 + guoba.support.js | 6 ++++++ utils/SydneyAIClient.js | 31 ++++++++++++++++--------------- utils/config.js | 3 ++- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/apps/management.js b/apps/management.js index e8e4dab..eb01125 100644 --- a/apps/management.js +++ b/apps/management.js @@ -276,6 +276,7 @@ export class ChatgptManagement extends plugin { } await this.reply(roleList) } + async ttsSwitch (e) { let userReplySetting = await redis.get(`CHATGPT:USER:${e.sender.user_id}`) userReplySetting = !userReplySetting diff --git a/guoba.support.js b/guoba.support.js index 73300b6..acfd056 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -377,6 +377,12 @@ export function supportGuoba () { bottomHelpMessage: '加强主人认知。希望机器人认清主人,避免NTR可开启。开启后可能会与自设定的内容有部分冲突。sydney模式可以放心开启', component: 'Switch' }, + { + field: 'enableGenerateContents', + label: '允许生成图像等内容', + bottomHelpMessage: '开启后类似网页版能够发图。但是此选项会占用大量token,自设定等模式下容易爆token', + component: 'Switch' + }, // { // field: 'cognitiveReinforcementTip', // label: '加强主人认知的后台prompt', diff --git a/utils/SydneyAIClient.js b/utils/SydneyAIClient.js index acaae73..43f3cc6 100644 --- a/utils/SydneyAIClient.js +++ b/utils/SydneyAIClient.js @@ -347,25 +347,26 @@ export default class SydneyAIClient { logger.mark('sydney websocket constructed successful') } const toneOption = 'h3imaginative' + let optionsSets = [ + 'nlu_direct_response_filter', + 'deepleo', + 'disable_emoji_spoken_text', + 'responsible_ai_policy_235', + 'enablemm', + toneOption, + 'dtappid', + 'cricinfo', + 'cricinfov2', + 'dv3sugg' + ] + if (Config.enableGenerateContents) { + optionsSets.push(...['clgalileo', 'gencontentv3', 'rai267']) + } const obj = { arguments: [ { source: 'cib', - optionsSets: [ - 'nlu_direct_response_filter', - 'deepleo', - 'disable_emoji_spoken_text', - 'responsible_ai_policy_235', - 'enablemm', - toneOption, - 'clgalileo', - 'gencontentv3', - 'rai267', - 'dtappid', - 'cricinfo', - 'cricinfov2', - 'dv3sugg' - ], + optionsSets, sliceIds: [ '222dtappid', '225cricinfo', diff --git a/utils/config.js b/utils/config.js index 7a3bbaf..a15ad67 100644 --- a/utils/config.js +++ b/utils/config.js @@ -122,7 +122,8 @@ const defaultConfig = { azureTTSEmotion: false, enhanceAzureTTSEmotion: false, autoJapanese: false, - version: 'v2.6.0' + enableGenerateContents: false, + version: 'v2.6.1' } const _path = process.cwd() let config = {}