Closed lswlc33 closed 1 year ago
字面意思,theb.ai 没有开放 api 跨域访问,请联系对方开放一下。
Bot detected the issue body's language is not English, translate it automatically.
Literally, theb.ai does not open api cross-domain access, please contact the other party to open it.
最近 theb.ai 开放了api 我使用openai一样的请求格式可以成功请求 下面是一个python例子
返回内容
但是在此项目使用会出现报错 设置:
报错内容:
Access to fetch at 'https://api.theb.ai/v1/chat/completions' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
该如何解决?