We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
作者您好: 众所周知的原因openai的api在国内访问很慢,我们做了cf国内代理,这样可以更快访问,请问如何修改默认的chatgpt的api访问地址从而加速访问?
The text was updated successfully, but these errors were encountered:
作者是直接调用的openai官方的python接口,如果要改的话,可以用下面的方式直接覆盖掉原始包的地址(下面是询问chatgpt给出的答案)
import openai # 使用上面定义的 API 密钥 openai.api_key = api_key # 使用您的自定义 API 基址 openai.api_base = "https://your-proxy-domain.com/v1" # 调用 API 的示例 response = openai.Completion.create( engine="davinci-codex", prompt="Some prompt text", max_tokens=100 )
Sorry, something went wrong.
只有两个文件提到了api.openai.com,你把这两个地方的地址改成你的应该就可以了
如果你用的是chat_paper.py,那你需要在每次调用的地方覆盖掉api_base
openai.api_key = self.chat_api_list[self.cur_api] openai.api_base = "https://your-proxy-domain.com/v1"
我想我提个PR解决下这个问题会比较好
No branches or pull requests
作者您好:
众所周知的原因openai的api在国内访问很慢,我们做了cf国内代理,这样可以更快访问,请问如何修改默认的chatgpt的api访问地址从而加速访问?
The text was updated successfully, but these errors were encountered: