Bin-Huang / chatbox

User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)
https://chatboxai.app
GNU General Public License v3.0
20.59k stars 2.09k forks source link

[Feature]希望支持 Cloudflare AI gateway #1152

Open woshizilong opened 7 months ago

woshizilong commented 7 months ago

问题描述 使用 Cloudflare AI gateway 建立 endpoint 后,在 chatbox 的设置画面设定到 API 域名后,使用报错了。 错误的内容是chatbox拼接网址中出现了两个v1,Cloudflare AI gateway 建立 endpoint被调用时自己会加一个v1,而您的代码 src/packages/llm.ts 中也会拼入一个v1。

解决思路 希望能将 /v1/chat/completions 这部分也可以使用设置画面进行设置。

hufang360 commented 5 months ago

+1。接口调用可查阅:https://developers.cloudflare.com/ai-gateway/providers/openai/

jayvzh commented 4 months ago

+1,现在直接替换https://api.openai.com为https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY时候会报错 遇到了来自 OpenAI API 的错误,一般是由错误设置或账户问题引起的。请检查 AI 设置和账户情况,或者点击这里查看常见问题文档。 API Error: Status Code 404, { "error": { "type": "invalid_request_error", "code": "unknown_url", "message": "Unknown request URL: POST /v1/v1/chat/completions. Please check the URL for typos, or see the docs at https://platform.openai.com/docs/api-reference/.", "param": null } }

zhou20120904 commented 4 months ago

+1 没什么好说的了