jtsang4 / claude-to-chatgpt

This project converts the API of Anthropic's Claude model to the OpenAI Chat API format.
MIT License
1.27k stars 150 forks source link

佬,claude疑似修改了API信息格式,您看看,我可以提供多个KEY给您测试 #30

Closed zisanjun closed 3 months ago

zisanjun commented 8 months ago

自claude3发布后,好像API格式被改了,有了更多的要求,出现了多种报错,如下:

{ "error": { "message": "messages: Unexpected role \"system\". The Messages API accepts a top-level system parameter, not \"system\" as an input message role. (request id: 2024031217275455426917732821996)", "type": "invalid_request_error", "param": "", "code": null } }

{"error":{"message":"messages: first message must use the \"user\" role (request id: 2024031211095676132633895366427) (request id: 2024031211095627433661757301115)","type":"invalid_request_error","param":"","code":null}}

{"success":false,"content":null,"tokenCount":0,"errorMessage":"{\"error\":{\"message\":\"messages: roles must alternate between \\"user\\" and \\"assistant\\", but found multiple \\"user\\" roles in a row (request id: 2024031218095472528132521153205)\",\"type\":\"invalid_request_error\",\"param\":\"\",\"code\":null}}","inputTokens":-1,"outputTokens":-1}

大佬 您有空可以看看 KEY我可以提供很多 您加我QQ84680396,我发给您,或者您留邮箱我发到您邮箱上

linkedlist771 commented 8 months ago

claude的API的system messsage加到函数调用里面了。不在messages里面了,做一个adapter就行了。

jtsang4 commented 3 months ago

ClaudeFlare Worker 版本已经更新,有需要可以直接使用。模型名称使用 claude 的就可以