xqdoo00o / ChatGPT-to-API

Scalable unofficial ChatGPT API for production.
650 stars 129 forks source link

与go-chatgpt-api 搭配使用,总是抛出422 Unprocessable Entity #16

Closed dreammis closed 10 months ago

dreammis commented 10 months ago

你好,我之前使用一直是搭配go-chatgpt-api使用的 近期我更新了go-chatgpt-api代码之后,总是出现 {"detail":[{"loc":["body","messages",0,"metadata"],"msg":"none is not an allowed value","type":"type_error.none.not_allowed"}]}

我尝试了许多次,我发现 单独传:

{
     "model": "text-davinci-002-render-sha",
     "messages": [ {"role": "user", "content": "你是谁?"}]
   }

是没问题的,但是如果你加入了system这个role,那么就会抛出这个问题

{
     "model": "text-davinci-002-render-sha",
     "messages": [{"role": "system", "content": "神奇"}, {"role": "user", "content": "你是谁?"}]
   }

我尝试解决了很久都没解决

所以想问下,你是如何与go-chatgpt-api搭配的,你是否出现过这个问题

xqdoo00o commented 10 months ago

这个应该是go-chatgpt-api的问题,没用过不太了解

dreammis commented 10 months ago

哦哦,确实可能是这个go-chatgpt-api的问题 因为我这边是使用这个go-chatgpt-api来作为API_REVERSE_PROXY的。 不知道老哥是用哪个作为reverse的?

dreammis commented 10 months ago

好吧,我发现,其实不用使用API_REVERSE_PROXY,也可以。。。

dreammis commented 10 months ago

再问下,不使用这个API_REVERSE_PROXY,能绕过cf吗?不知道你在使用过程中有没有遇到过问题

xqdoo00o commented 10 months ago

再问下,不使用这个API_REVERSE_PROXY,能绕过cf吗?不知道你在使用过程中有没有遇到过问题

绕过cf代码拷贝的go-chatgpt-api的,所以你只是转api的话 不需要go-chatgpt-api的,也不用API_REVERSE_PROXY

dreammis commented 10 months ago

也就是说,你这个工程内置了绕过cf的部分了吗?

xqdoo00o commented 10 months ago

也就是说,你这个工程内置了绕过cf的部分了吗?