aurora icon indicating copy to clipboard operation
aurora copied to clipboard

Add support for ChatGPTUnofficialProxyAPI

Open yjmp14 opened this issue 1 year ago • 2 comments

Add support for ChatGPTUnofficialProxyAPI.

添加 /backend-api/conversation 路由,该路求接收网页版 ChatGPT 格式的请求,返回网页版 ChatGPT 格式的响应。

当环境变量 USE_DB=true 时使用数据库储存 conversation_idoai-device-id 的关系,默认不使用。

支持通过请求头 Authorization: Bearer xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 传入 oai-device-id

支持同时添加自定义 Authorization 以及 OpenAI accessTokenoai-device-id,中间通过空格分隔,例: Authorization: Bearer MySecretWord xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

yjmp14 avatar Apr 11 '24 14:04 yjmp14

感谢支持,uuid传到请求头里面吧。就不要上数据库了,这样很没有必要。我今天早上说过了 不是

xiaozhou26 avatar Apr 11 '24 14:04 xiaozhou26

默认是不使用数据库的,只有环境变量明确了才会用,应该还好吧。默认状态下启动应用和原来几乎一样,只是多了一个路由接口。

API 端使用数据库可以让客户端应用无需任何改动就能直接使用,不用数据库的话客户端就要记录 conversation_idoai-device-id 的关系,每次请求要用不同的请求头,应用起来比较麻烦。

yjmp14 avatar Apr 11 '24 15:04 yjmp14

chatgpt-web:https://github.com/Chanzhaoyu/chatgpt-web 设置:USE_DB=true,环境:koyeb 第一条消息正常,第二条消息开始提示错误。大佬帮忙看看呢。 ChatGPT error 404: {"error":{"code":"error","message":{"code":"conversation_not_found","message":"Conversation not found"},"param":null,"type":"404 Not Found"}}

zengge99 avatar Apr 15 '24 07:04 zengge99

chatgpt-web:https://github.com/Chanzhaoyu/chatgpt-web 设置:USE_DB=true,环境:koyeb 第一条消息正常,第二条消息开始提示错误。大佬帮忙看看呢。 ChatGPT error 404: {"error":{"code":"error","message":{"code":"conversation_not_found","message":"Conversation not found"},"param":null,"type":"404 Not Found"}}

原作者不想在项目中引入数据库,所以移除了这个功能。 你可以在 chatgpt-web 中设置任意一个 uuid 作为 api key;或者使用我的 fork,保留了使用数据库的功能。

yjmp14 avatar Apr 15 '24 12:04 yjmp14

chatgpt-web:https://github.com/Chanzhaoyu/chatgpt-web 设置:USE_DB=true,环境:koyeb 第一条消息正常,第二条消息开始提示错误。大佬帮忙看看呢。 ChatGPT error 404: {"error":{"code":"error","message":{"code":"conversation_not_found","message":"Conversation not found"},"param":null,"type":"404 Not Found"}}

原作者不想在项目中引入数据库,所以移除了这个功能。 你可以在 chatgpt-web 中设置任意一个 uuid 作为 api key;或者使用我的 fork,保留了使用数据库的功能。

了解了,感谢🙏 就是把OPENAI_ACCESS_TOKEN设置成任意uuid,对吧?

zengge99 avatar Apr 15 '24 12:04 zengge99

chatgpt-web:https://github.com/Chanzhaoyu/chatgpt-web 设置:USE_DB=true,环境:koyeb 第一条消息正常,第二条消息开始提示错误。大佬帮忙看看呢。 ChatGPT error 404: {"error":{"code":"error","message":{"code":"conversation_not_found","message":"Conversation not found"},"param":null,"type":"404 Not Found"}}

原作者不想在项目中引入数据库,所以移除了这个功能。 你可以在 chatgpt-web 中设置任意一个 uuid 作为 api key;或者使用我的 fork,保留了使用数据库的功能。

了解了,感谢🙏 就是把OPENAI_ACCESS_TOKEN设置成任意uuid,对吧?

对的。

yjmp14 avatar Apr 15 '24 12:04 yjmp14

chatgpt-web:https://github.com/Chanzhaoyu/chatgpt-web 设置:USE_DB=true,环境:koyeb 第一条消息正常,第二条消息开始提示错误。大佬帮忙看看呢。 ChatGPT error 404: {"error":{"code":"error","message":{"code":"conversation_not_found","message":"Conversation not found"},"param":null,"type":"404 Not Found"}}

原作者不想在项目中引入数据库,所以移除了这个功能。 你可以在 chatgpt-web 中设置任意一个 uuid 作为 api key;或者使用我的 fork,保留了使用数据库的功能。

了解了,感谢🙏 就是把OPENAI_ACCESS_TOKEN设置成任意uuid,对吧?

对的。

挺好用的。如果想免登陆就设置成uuid,如果用自己的账号就填网页access token。非常感谢!

zengge99 avatar Apr 15 '24 12:04 zengge99