diff --git a/apps/prompts.js b/apps/prompts.js index a78e4d3..65c2524 100644 --- a/apps/prompts.js +++ b/apps/prompts.js @@ -159,7 +159,8 @@ export class help extends plugin { Custom: 'sydney', claude: 'slackClaudeGlobalPreset', qwen: 'promptPrefixOverride', - gemini: 'geminiPrompt' + gemini: 'geminiPrompt', + xh: 'xhPrompt' } if (keyMap[use]) { @@ -169,6 +170,9 @@ export class help extends plugin { } else { Config[keyMap[use]] = prompt.content } + if (use === 'xh') { + Config.xhPromptSerialize = false + } await redis.set(`CHATGPT:PROMPT_USE_${use}`, promptName) await e.reply(`你当前正在使用${use}模式,已将该模式设定应用为"${promptName}"。更该设定后建议结束对话以使设定更好生效`, true) } else { diff --git a/guoba.support.js b/guoba.support.js index a3a6a0b..85ca3fb 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -631,6 +631,7 @@ export function supportGuoba () { { label: '讯飞星火认知大模型V1.5', value: 'api' }, { label: '讯飞星火认知大模型V2.0', value: 'apiv2' }, { label: '讯飞星火认知大模型V3.0', value: 'apiv3' }, + { label: '讯飞星火认知大模型V3.5', value: 'apiv3.5' }, { label: '讯飞星火助手', value: 'assistants' } ] } diff --git a/utils/xinghuo/xinghuo.js b/utils/xinghuo/xinghuo.js index b090410..3040f79 100644 --- a/utils/xinghuo/xinghuo.js +++ b/utils/xinghuo/xinghuo.js @@ -86,6 +86,8 @@ export default class XinghuoClient { APILink = '/v2.1/chat' } else if (Config.xhmode === 'apiv3') { APILink = '/v3.1/chat' + } else if (Config.xhmode === 'apiv3.5') { + APILink = '/v3.5/chat' } const date = new Date().toGMTString() const algorithm = 'hmac-sha256' @@ -176,7 +178,13 @@ export default class XinghuoClient { const wsUrl = Config.xhmode == 'assistants' ? Config.xhAssistants : await this.getWsUrl() if (!wsUrl) throw new Error('获取ws链接失败') let domain = 'general' - if (Config.xhmode == 'apiv2') { domain = 'generalv2' } else if (Config.xhmode == 'apiv3') { domain = 'generalv3' } + if (Config.xhmode == 'apiv2') { + domain = 'generalv2' + } else if (Config.xhmode == 'apiv3') { + domain = 'generalv3' + } else if (Config.xhmode == 'apiv3.5') { + domain = 'generalv3.5' + } // 编写消息内容 const wsSendData = { header: { @@ -375,7 +383,7 @@ export default class XinghuoClient { let chatId = option?.chatId let image = option?.image - if (Config.xhmode == 'api' || Config.xhmode == 'apiv2' || Config.xhmode == 'apiv3' || Config.xhmode == 'assistants') { + if (Config.xhmode == 'api' || Config.xhmode == 'apiv2' || Config.xhmode == 'apiv3' || Config.xhmode == 'apiv3.5' || Config.xhmode == 'assistants') { if (!Config.xhAppId || !Config.xhAPISecret || !Config.xhAPIKey) throw new Error('未配置api') let Prompt = [] // 设定 @@ -387,7 +395,7 @@ export default class XinghuoClient { logger.warn('星火设定序列化失败,本次对话不附带设定') } } else { - Prompt = Config.xhPrompt ? [{ role: 'user', content: Config.xhPrompt }] : [] + Prompt = Config.xhPrompt ? [{ role: 'system', content: Config.xhPrompt }] : [] } if (Config.xhPromptEval) { Prompt.forEach(obj => {