fix: 开启内容生成会爆token的问题

This commit is contained in:
ikechan8370 2023-05-21 18:54:14 +08:00
parent d88550db39
commit 758aeb67a2
4 changed files with 25 additions and 16 deletions

View file

@ -276,6 +276,7 @@ export class ChatgptManagement extends plugin {
} }
await this.reply(roleList) await this.reply(roleList)
} }
async ttsSwitch (e) { async ttsSwitch (e) {
let userReplySetting = await redis.get(`CHATGPT:USER:${e.sender.user_id}`) let userReplySetting = await redis.get(`CHATGPT:USER:${e.sender.user_id}`)
userReplySetting = !userReplySetting userReplySetting = !userReplySetting

View file

@ -377,6 +377,12 @@ export function supportGuoba () {
bottomHelpMessage: '加强主人认知。希望机器人认清主人避免NTR可开启。开启后可能会与自设定的内容有部分冲突。sydney模式可以放心开启', bottomHelpMessage: '加强主人认知。希望机器人认清主人避免NTR可开启。开启后可能会与自设定的内容有部分冲突。sydney模式可以放心开启',
component: 'Switch' component: 'Switch'
}, },
{
field: 'enableGenerateContents',
label: '允许生成图像等内容',
bottomHelpMessage: '开启后类似网页版能够发图。但是此选项会占用大量token自设定等模式下容易爆token',
component: 'Switch'
},
// { // {
// field: 'cognitiveReinforcementTip', // field: 'cognitiveReinforcementTip',
// label: '加强主人认知的后台prompt', // label: '加强主人认知的后台prompt',

View file

@ -347,25 +347,26 @@ export default class SydneyAIClient {
logger.mark('sydney websocket constructed successful') logger.mark('sydney websocket constructed successful')
} }
const toneOption = 'h3imaginative' 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 = { const obj = {
arguments: [ arguments: [
{ {
source: 'cib', source: 'cib',
optionsSets: [ optionsSets,
'nlu_direct_response_filter',
'deepleo',
'disable_emoji_spoken_text',
'responsible_ai_policy_235',
'enablemm',
toneOption,
'clgalileo',
'gencontentv3',
'rai267',
'dtappid',
'cricinfo',
'cricinfov2',
'dv3sugg'
],
sliceIds: [ sliceIds: [
'222dtappid', '222dtappid',
'225cricinfo', '225cricinfo',

View file

@ -122,7 +122,8 @@ const defaultConfig = {
azureTTSEmotion: false, azureTTSEmotion: false,
enhanceAzureTTSEmotion: false, enhanceAzureTTSEmotion: false,
autoJapanese: false, autoJapanese: false,
version: 'v2.6.0' enableGenerateContents: false,
version: 'v2.6.1'
} }
const _path = process.cwd() const _path = process.cwd()
let config = {} let config = {}