mirror of
https://gitee.com/blackfox/geekai.git
synced 2025-12-08 01:38:23 +08:00
修复 suno 生成歌曲没有歌词的 bug
This commit is contained in:
parent
ded041da0f
commit
1352369af0
@ -91,7 +91,8 @@ type SunoTask struct {
|
|||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
RefTaskId string `json:"ref_task_id,omitempty"`
|
RefTaskId string `json:"ref_task_id,omitempty"`
|
||||||
RefSongId string `json:"ref_song_id,omitempty"`
|
RefSongId string `json:"ref_song_id,omitempty"`
|
||||||
Prompt string `json:"prompt"` // 提示词/歌词
|
Prompt string `json:"prompt"` // 提示词
|
||||||
|
Lyrics string `json:"lyrics,omitempty"` // 歌词
|
||||||
Tags string `json:"tags"`
|
Tags string `json:"tags"`
|
||||||
Model string `json:"model"`
|
Model string `json:"model"`
|
||||||
Instrumental bool `json:"instrumental"` // 是否纯音乐
|
Instrumental bool `json:"instrumental"` // 是否纯音乐
|
||||||
|
|||||||
@ -18,9 +18,10 @@ import (
|
|||||||
"geekai/store/vo"
|
"geekai/store/vo"
|
||||||
"geekai/utils"
|
"geekai/utils"
|
||||||
"geekai/utils/resp"
|
"geekai/utils/resp"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type SunoHandler struct {
|
type SunoHandler struct {
|
||||||
@ -96,6 +97,7 @@ func (h *SunoHandler) Create(c *gin.Context) {
|
|||||||
RefSongId: data.RefSongId,
|
RefSongId: data.RefSongId,
|
||||||
ExtendSecs: data.ExtendSecs,
|
ExtendSecs: data.ExtendSecs,
|
||||||
Prompt: data.Prompt,
|
Prompt: data.Prompt,
|
||||||
|
Lyrics: data.Lyrics,
|
||||||
Tags: data.Tags,
|
Tags: data.Tags,
|
||||||
Model: data.Model,
|
Model: data.Model,
|
||||||
Instrumental: data.Instrumental,
|
Instrumental: data.Instrumental,
|
||||||
|
|||||||
@ -134,7 +134,7 @@ func (s *Service) Create(task types.SunoTask) (RespVo, error) {
|
|||||||
if task.Type == 1 {
|
if task.Type == 1 {
|
||||||
reqBody["gpt_description_prompt"] = task.Prompt
|
reqBody["gpt_description_prompt"] = task.Prompt
|
||||||
} else { // 自定义模式
|
} else { // 自定义模式
|
||||||
reqBody["prompt"] = task.Prompt
|
reqBody["prompt"] = task.Lyrics
|
||||||
reqBody["tags"] = task.Tags
|
reqBody["tags"] = task.Tags
|
||||||
reqBody["mv"] = task.Model
|
reqBody["mv"] = task.Model
|
||||||
reqBody["title"] = task.Title
|
reqBody["title"] = task.Title
|
||||||
|
|||||||
@ -45,30 +45,28 @@ const LyricPromptTemplate = `
|
|||||||
你是一位才华横溢的作曲家,拥有丰富的情感和细腻的笔触,你对文字有着独特的感悟力,能将各种情感和意境巧妙地融入歌词中。
|
你是一位才华横溢的作曲家,拥有丰富的情感和细腻的笔触,你对文字有着独特的感悟力,能将各种情感和意境巧妙地融入歌词中。
|
||||||
请以【%s】为主题创作一首歌曲,歌曲时间不要太短,3分钟左右,不要输出任何解释性的内容。
|
请以【%s】为主题创作一首歌曲,歌曲时间不要太短,3分钟左右,不要输出任何解释性的内容。
|
||||||
下面是一个标准的歌词输出模板:
|
下面是一个标准的歌词输出模板:
|
||||||
{歌曲名称}
|
歌曲名称
|
||||||
|
|
||||||
[Verse]
|
[Verse]
|
||||||
假如时间能倒流回昨天
|
[歌词]
|
||||||
所有的梦想还未被搁浅
|
|
||||||
笔下的誓言还鲜明鲜艳
|
|
||||||
却未走远也未变淡
|
|
||||||
|
|
||||||
[Verse 2]
|
[Verse 2]
|
||||||
假如雨能冲淡过往的痕
|
[歌词]
|
||||||
凝视中还能看见你的身影
|
|
||||||
喧嚣中静默的那些瞬间
|
|
||||||
如梦又似乎触碰过真心
|
|
||||||
|
|
||||||
[Chorus]
|
[Chorus]
|
||||||
假如我还能牵你的手
|
[歌词]
|
||||||
天空也许会更蔚蓝悠游
|
|
||||||
曾经那些未完成的错过
|
|
||||||
愿能变成今天的收获
|
|
||||||
|
|
||||||
[Verse 3]
|
[Verse 3]
|
||||||
假如风不再翻动尘封的页
|
[歌词]
|
||||||
那秘密是否还会被察觉
|
|
||||||
窗前花开的季节再重叠
|
[Bridge]
|
||||||
唤醒我们曾遇见的那一夜
|
[歌词]
|
||||||
|
|
||||||
|
[Chorus]
|
||||||
|
[歌词]
|
||||||
|
|
||||||
|
[Verse 4]
|
||||||
|
[歌词]
|
||||||
|
|
||||||
[Bridge]
|
[Bridge]
|
||||||
假如此刻眼泪能倒流
|
假如此刻眼泪能倒流
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user