disingn / sunotoapi

将 sunoAi web转成 openai 格式进行调用
187 stars 33 forks source link

作者大大,能不能打算直接支持v1/chat/completions接口,拿对话当作提示词,模型当作音乐模型 #1

Closed Yanyutin753 closed 5 months ago

Yanyutin753 commented 5 months ago

这样方便调用,而且一次性获取所创作的音乐信息,不用请求多次获取

disingn commented 5 months ago

这样方便调用,而且一次性获取所创作的音乐信息,不用请求多次获取

什么意思呢?给个格式

Yanyutin753 commented 5 months ago

先创建任务

curl --location --request POST 'localhost:3560/v2/generate' \
--header 'Content-Type: application/json' \
--data-raw '{
    "gpt_description_prompt": "an atmospheric metal song about dancing all night long",
    "mv": "chirp-v3-0",
    "prompt": "",
    "make_instrumental": false
}'

那我可不可以使用v1/chat/completions接口,例如

{
  "model": "gpt-4",
  "stream": true,
  "frequency_penalty": 0,
  "presence_penalty": 0,
  "temperature": 0.6,
  "top_p": 1,
  "messages": [
    {
      "content": "帮我创建一首歌\n",
      "role": "user"
    }
  ]
}

之后我提取里面的modelstreamcontent 作为 mv返回方式prompt,然后我在程序里面保存的id,并查询相应的歌曲信息,之后按照stream值来进行流式或者非流式传输

Yanyutin753 commented 5 months ago

这样就可以实现最简单的直接在自己的web端或者其他平台使用这个接口 以上只是我的一个小小的建议,希望作者大大能看看♥♥♥

disingn commented 5 months ago

这样就可以实现最简单的直接在自己的web端或者其他平台使用这个接口 以上只是我的一个小小的建议,希望作者大大能看看♥♥♥

已经兼容 看最新的 readme

Yanyutin753 commented 5 months ago

牛逼作者大大👍

spacex-3 commented 5 months ago

牛逼作者大大👍

佬,接入oneapi然后接入到wechat bot,每次返回都错误,但是网页上是有记录的

这个是请求的header(oneapi必须填入密钥请求)的问题,还是返回的json的问题?还是延迟的问题呀?

itq5 commented 5 months ago

Awesome! 👍 It seems like you might have forgotten to include the text you want translated. Could you please provide the text you're referring to? Bro, I integrated with oneapi and then connected it to the WeChat bot, but every time the response is incorrect, although there are records on the website Certainly, please provide the text you would like to have translated into English Is this an issue with the requested header (where oneapi requires the key to be filled in for the request), an issue with the returned JSON, or a latency issue?

I have records in the backend, but I switched through several frontend projects> > 牛逼作者大大👍

佬,接入oneapi然后接入到wechat bot,每次返回都错误,但是网页上是有记录的

这个是请求的header(oneapi必须填入密钥请求)的问题,还是返回的json的问题?还是延迟的问题呀?

我后端有记录,但是我换了好几个前端项目 nineai lobechat都页面没法直接显示,不知道怎么解决