diff --git a/apps/management.js b/apps/management.js index 65cb76e..6bd69e2 100644 --- a/apps/management.js +++ b/apps/management.js @@ -1057,7 +1057,7 @@ azure语音:Azure 语音是微软 Azure 平台提供的一项语音服务, let map = { 精准: 'Precise', 创意: 'Creative', - 均衡: 'Precise', + 均衡: 'Balanced', Sydney: 'Creative', sydney: 'Creative', 悉尼: 'Creative', @@ -1069,7 +1069,7 @@ azure语音:Azure 语音是微软 Azure 平台提供的一项语音服务, Config.toneStyle = map[tongStyle] await this.reply('切换成功') } else { - await this.reply('没有这种风格。支持的风格:`精准`和`创意`,均支持设定') + await this.reply('没有这种风格。支持的风格:`精准`、`均衡`和`创意`,均支持设定') } } @@ -1103,9 +1103,11 @@ azure语音:Azure 语音是微软 Azure 平台提供的一项语音服务, api3: 'API3', chatglm: 'ChatGLM-6B', claude: 'Claude', - poe: 'Poe', + claude2: 'claude.ai', + chatglm4: 'ChatGLM-4', xh: '星火', - qwen: '通义千问' + qwen: '通义千问', + gemini: 'Gemini' } let modeText = modeMap[mode || 'api'] let message = `请访问yunzai.chat查看文档。当前为 ${modeText} 模式。` diff --git a/guoba.support.js b/guoba.support.js index 019d665..293d7ce 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -180,11 +180,12 @@ export function supportGuoba () { { field: 'toneStyle', label: 'Bing模式', - bottomHelpMessage: 'Copilot的应答风格。默认为创意,可切换为精准,均支持添加设定', + bottomHelpMessage: 'Copilot的应答风格。默认为创意,可切换为精准或均衡,均为GPT-turbo', component: 'Select', componentProps: { options: [ { label: '创意', value: 'Creative' }, + { label: '均衡', value: 'Balanced' }, { label: '精准', value: 'Precise' } ] } @@ -218,23 +219,12 @@ export function supportGuoba () { bottomHelpMessage: '加强主人认知。希望机器人认清主人,避免NTR可开启。开启后可能会与自设定的内容有部分冲突。sydney模式可以放心开启', component: 'Switch' }, - { - field: 'sydneyGPT4Turbo', - label: '使用GPT4-turbo', - bottomHelpMessage: '目前仅Copilot Pro可开启。非pro用户开启会报错。', - component: 'Switch' - }, { field: 'enableGenerateContents', label: '允许生成图像等内容', bottomHelpMessage: '开启后类似网页版能够发图。但是此选项会占用大量token,自设定等模式下容易爆token', component: 'Switch' }, - // { - // field: 'cognitiveReinforcementTip', - // label: '加强主人认知的后台prompt', - // component: 'InputTextArea' - // }, { field: 'groupContextLength', label: '允许机器人读取近期的最多群聊聊天记录条数。', diff --git a/utils/SydneyAIClient.js b/utils/SydneyAIClient.js index 7d3334b..1601b46 100644 --- a/utils/SydneyAIClient.js +++ b/utils/SydneyAIClient.js @@ -384,55 +384,8 @@ export default class SydneyAIClient { if (tone.toLowerCase() === 'sydney' || tone.toLowerCase() === 'custom') { Config.toneStyle = 'Creative' } - const isCreative = tone.toLowerCase().includes('creative') - const toneOption = isCreative ? 'h3imaginative' : 'h3precise' - let optionsSets = [ - 'nlu_direct_response_filter', - 'deepleo', - 'disable_emoji_spoken_text', - 'responsible_ai_policy_235', - 'enablemm', - toneOption, - // 'dagslnv1', - // 'sportsansgnd', - // 'dl_edge_desc', - // 'noknowimg', - // 'dtappid', - // 'cricinfo', - // 'cricinfov2', - 'dv3sugg', - 'autosave', - // 'gencontentv3', - 'iycapbing', - 'iyxapbing', - // 'revimglnk', - // 'revimgsi2', - // 'revimgsrc1', - // 'revimgur', - // 'clgalileo', - // 'eredirecturl', - // copilot - 'uquopt', - // 'botthrottle', - // 'dlimitationnc', - // 'hourthrot', - // 'gndlogcf', - // 'ciorigimage', - // 'codeintfile', - 'eredirecturl', - // 'ldsummary', - // 'ldqa', - // 'sdretrieval', - // "gencontentv3", - // 'gpt4tmncnp' - ] - if (!isCreative) { - optionsSets.push('clgalileo') - } + let optionsSets = getOptionSet(Config.toneStyle, Config.enableGenerateContents) let source = 'cib-ccp'; let gptId = 'copilot' - if (Config.enableGenerateContents) { - optionsSets.push(...['gencontentv3']) - } if (!Config.sydneyEnableSearch || toSummaryFileContent?.content) { optionsSets.push(...['nosearchall']) } @@ -440,11 +393,6 @@ export default class SydneyAIClient { tone = tone + 'Classic' invocationId = 2 } - if (Config.sydneyGPT4Turbo) { - // tone = 'Creative' - // optionsSets.push('gpt4tmnc') - invocationId = 1 - } // wtf gpts? // if (Config.sydneyGPTs === 'Designer') { // optionsSets.push(...['ai_persona_designer_gpt', 'flux_websearch_v14']) @@ -484,32 +432,7 @@ export default class SydneyAIClient { 'SearchQuery', 'GeneratedCode' ], - sliceIds: [ - // 'supllmnfe', - // 'nodescf', - // 'stcheckcf', - // 'invldrqcf', - // 'v6voice', - // 'vnextr100', - // 'sydvrate100', - // 'vnextvoice', - // 'scmcbasecf', - // 'cmcpupsalltf', - // 'sydtransjson', - // 'thdnsrchcf', - // '220dcl1bt15', - // '311dlicnc', - // '0215wcrwippsr', - // '0305hrthrot', - // '0130gpt4t', - // 'bingfccf', - // 'dissagrds0', - // '0228scs', - // 'scprompt1', - // '228pyfilenfb', - // 'ecipc', - // '3022tpvs0' - ], + sliceIds: [], requestId: crypto.randomUUID(), traceId: genRanHex(32), scenario: 'SERP', @@ -566,17 +489,17 @@ export default class SydneyAIClient { spokenTextMode: 'None', conversationId, previousMessages, - // plugins: [ - // { - // id: 'c310c353-b9f0-4d76-ab0d-1dd5e979cf68', - // category: 1 - // } - // ], - // extraExtensionParameters: { - // 'gpt-creator-persona': { - // personaId: 'copilot' - // } - // } + plugins: [ + { + id: 'c310c353-b9f0-4d76-ab0d-1dd5e979cf68', + category: 1 + } + ], + extraExtensionParameters: { + 'gpt-creator-persona': { + personaId: 'copilot' + } + } } if (encryptedconversationsignature) { @@ -1026,3 +949,73 @@ async function generateRandomIP () { await redis.set('CHATGPT:BING_IP', ip, { EX: 86400 * 7 }) return ip } + +/** + * + * @param {'Precise' | 'Balanced' | 'Creative'} tone + */ +function getOptionSet (tone, generateContent = false) { + let optionset = [ + 'nlu_direct_response_filter', + 'deepleo', + 'disable_emoji_spoken_text', + 'responsible_ai_policy_235', + 'enablemm', + 'dv3sugg', + 'autosave', + 'iyxapbing', + 'iycapbing', + 'enable_user_consent', + 'fluxmemcst' + ] + switch (tone) { + case 'Precise': + optionset.push(...[ + 'h3precise', + 'sunoupsell', + 'botthrottle', + 'dlimitationnc', + 'hourthrot', + 'elec2t', + 'elecgnd', + 'gndlogcf', + 'eredirecturl', + 'clgalileo', + 'gencontentv3' + ]) + break + case 'Balance': + optionset.push(...[ + 'galileo', + 'saharagenconv5', + 'sunoupsell', + 'botthrottle', + 'dlimitationnc', + 'hourthrot', + 'elec2t', + 'elecgnd', + 'gndlogcf', + 'eredirecturl' + ]) + break + case 'Creative': + optionset.push(...[ + 'h3imaginative', + 'sunoupsell', + 'botthrottle', + 'dlimitationnc', + 'hourthrot', + 'elec2t', + 'elecgnd', + 'gndlogcf', + 'eredirecturl', + 'clgalileo', + 'gencontentv3' + ]) + break + } + if (generateContent) { + optionset.push('gencontentv3') + } + return optionset +} diff --git a/utils/alibaba/qwen-api.js b/utils/alibaba/qwen-api.js index 2577e5c..a5906f2 100644 --- a/utils/alibaba/qwen-api.js +++ b/utils/alibaba/qwen-api.js @@ -218,6 +218,7 @@ var QwenApi = /** @class */ (function () { } result.detail = response; result.text = response.output.choices[0].message.content; + result.conversation = messages; return [2 /*return*/, resolve(result)]; case 6: err_1 = _f.sent(); diff --git a/utils/alibaba/qwen-api.ts b/utils/alibaba/qwen-api.ts index 4bcc79c..3d1afe4 100644 --- a/utils/alibaba/qwen-api.ts +++ b/utils/alibaba/qwen-api.ts @@ -228,6 +228,7 @@ export class QwenApi { } result.detail = response result.text = response.output.choices[0].message.content + result.conversation = messages return resolve(result) } catch (err) { return reject(err) diff --git a/utils/config.js b/utils/config.js index d8319c2..54dfa8a 100644 --- a/utils/config.js +++ b/utils/config.js @@ -31,6 +31,9 @@ const defaultConfig = { drawCD: 30, model: '', temperature: 0.8, + /** + * @type {'Precise' | 'Balanced' | 'Creative'} + */ toneStyle: 'Creative', sydney: pureSydneyInstruction, sydneyReverseProxy: 'https://666102.201666.xyz', @@ -40,7 +43,6 @@ const defaultConfig = { sydneyBrainWashStrength: 15, sydneyBrainWashName: 'Sydney', sydneyMood: false, - sydneyGPT4Turbo: false, sydneyGPTs: 'Copilot', sydneyImageRecognition: false, sydneyMoodTip: 'Your response should be divided into two parts, namely, the text and your mood. The mood available to you can only include: blandness, happy, shy, frustrated, disgusted, and frightened.All content should be replied in this format {"text": "", "mood": ""}.All content except mood should be placed in text, It is important to ensure that the content you reply to can be parsed by json.',