diff --git a/apps/chat.js b/apps/chat.js index 3cbe2e9..56236bf 100644 --- a/apps/chat.js +++ b/apps/chat.js @@ -832,7 +832,7 @@ export class chatgpt extends plugin { } } // 处理suno生成 - if ((use === 'bing' || use === 'xh') && Config.enableChatSuno) { + if ((use === 'bing' || use === 'xh' || use === 'gemini') && Config.enableChatSuno) { const sunoList = extractMarkdownJson(chatMessage.text) for (let suno of sunoList) { if (suno.json.option == 'Suno') { diff --git a/model/core.js b/model/core.js index 1157ced..74f153f 100644 --- a/model/core.js +++ b/model/core.js @@ -645,6 +645,11 @@ class Core { } promptAddition && (prompt += promptAddition) option.systemMessage = await handleSystem(e, opts.systemMessage) + /* + if (Config.enableChatSuno) { + option.systemMessage += '如果我要求你生成音乐或写歌,你需要回复适合Suno生成音乐的信息。请使用Verse、Chorus、Bridge、Outro和End等关键字对歌词进行分段,如[Verse]。返回的消息需要使用markdown包裹的JSON格式,结构为```json{"option": "Suno", "tags": "style", "title": "title of the song", "lyrics": "lyrics"}```。' + } + */ systemAddition && (option.systemMessage += systemAddition) opts.completionParams.parameters.tools = Object.keys(funcMap) .map(k => funcMap[k].function) @@ -811,6 +816,9 @@ class Core { .join('\n') } } + if (Config.enableChatSuno) { + system += 'If I ask you to generate music or write songs, you need to reply with information suitable for Suno to generate music. Please use keywords such as Verse, Chorus, Bridge, Outro, and End to segment the lyrics, such as [Verse], The returned message is in JSON format, with a structure of ```json{"option": "Suno", "tags": "style", "title": "title of the song", "lyrics": "lyrics"}```.' + } option.system = system return await client.sendMessage(prompt, option) } else if (use === 'chatglm4') { @@ -834,6 +842,11 @@ class Core { let maxModelTokens = getMaxModelTokens(completionParams.model) // let system = promptPrefix let system = await handleSystem(e, promptPrefix, maxModelTokens) + /* + if (Config.enableChatSuno) { + system += 'If I ask you to generate music or write songs, you need to reply with information suitable for Suno to generate music. Please use keywords such as Verse, Chorus, Bridge, Outro, and End to segment the lyrics, such as [Verse], The returned message is in JSON format, with a structure of ```json{"option": "Suno", "tags": "style", "title": "title of the song", "lyrics": "lyrics"}```.' + } + */ logger.debug(system) let opts = { apiBaseUrl: Config.openAiBaseUrl, diff --git a/resources/view/setting_view.json b/resources/view/setting_view.json index 6a3a039..78146ab 100644 --- a/resources/view/setting_view.json +++ b/resources/view/setting_view.json @@ -70,13 +70,29 @@ "value": "xh" }, { - "label": "Slack Claude", - "value": "claude" + "label": "通义千问", + "value": "qwen" }, { "label": "Gemini", "value": "gemini" }, + { + "label": "Slack Claude", + "value": "claude" + }, + { + "label": "Claude2", + "value": "claude2" + }, + { + "label": "ChatGLM4", + "value": "chatglm4" + }, + { + "label": "ChatGLM", + "value": "chatglm" + }, { "label": "Azure OpenAI", "value": "azure" @@ -85,10 +101,6 @@ "label": "ChatGPT API3", "value": "api3" }, - { - "label": "ChatGLM", - "value": "chatglm" - }, { "label": "浏览器", "value": "browser"