easychen / chatchan-dist

Chat酱独立部署版,docker方案自带代理
https://chatchan-dist-blush.vercel.app
741 stars 110 forks source link

是否增加对CloudFlare AI Gateway的支持? #45

Open WyInnovate opened 9 months ago

WyInnovate commented 9 months ago

Easy大佬,能否增加对CloudFlare AI Gateway的支持,CloudFlare AI Gateway能实现缓存结果、日志记录、自动统计token消耗 官方文档如下:https://developers.cloudflare.com/ai-gateway/

easychen commented 9 months ago

按官方文档说明,你只需要把 baseURL 设置为 "https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/openai" 应该就能用了吧?

WyInnovate commented 9 months ago

按官方文档说明,你只需要把 baseURL 设置为 "gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/openai" 应该就能用了吧?

我的baseURL是:https://gateway.ai.cloudflare.com/v1/XXX/XXX/openai

chanchen中发送消息获得的错误提示

错误:[404]:Error: [404]: { "error": { "message": "Invalid URL (POST /v1/v1/chat/completions)", "type": "invalid_request_error", "param": null, "code": null } }

AI Gateway实时日志

chanchen error

Endpoint
v1/chat/completions

另一个正确的

Endpoint
chat/completions