修改suno伪造生成策略,支持更多模型调用

This commit is contained in:
zyc404 2024-05-08 15:32:49 +08:00
parent 123e5304a7
commit d111d2625e
7 changed files with 86 additions and 30 deletions

View file

@ -338,7 +338,7 @@ export default class SydneyAIClient {
((Config.enableGroupContext && groupId) ? groupContextTip : '') +
((Config.enforceMaster && master) ? masterTip : '') +
(Config.sydneyMood ? moodTip : '') +
((!Config.enableGenerateSuno && Config.bingSuno != 'bing' && Config.enableGenerateSunoForger) ? '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 {"option": "Suno", "tags": "style", "title": "title of the song", "lyrics": "lyrics"}.' : '')
((!Config.enableGenerateSuno && Config.enableChatSuno) ? '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 {"option": "Suno", "tags": "style", "title": "title of the song", "lyrics": "lyrics"}.' : '')
if (!text) {
previousMessages = pm
} else {
@ -835,17 +835,6 @@ export default class SydneyAIClient {
message.adaptiveCards = adaptiveCardsSoFar
message.text = replySoFar.join('')
}
// 伪造歌曲生成
if (Config.enableGenerateSunoForger) {
const sunoList = extractMarkdownJson(message.text)
for (let suno of sunoList) {
if (suno.json.option == 'Suno') {
message.text = message.text.replace(suno.markdown, `歌曲 《${suno.json.title}`)
logger.info(`开始生成歌曲${suno.json.tags}`)
onSunoCreateRequest(suno.json)
}
}
}
resolve({
message,
conversationExpiryTime: event?.item?.conversationExpiryTime