fix: 增加均衡模式

This commit is contained in:
ikechan8370 2024-03-15 10:52:21 +08:00
parent b822e49d9a
commit a4d07b9d46
6 changed files with 96 additions and 107 deletions

View file

@ -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
}

View file

@ -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();

View file

@ -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)

View file

@ -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.',