Skip to content
New issue

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

Support custom OpenAI API endpoint #84

Merged
merged 1 commit into from
May 13, 2023
Merged

Support custom OpenAI API endpoint #84

merged 1 commit into from
May 13, 2023

Conversation

qihangnet
Copy link
Contributor

Setting custom endpoint can solve the problem of Chinese users not being able to directly access OpenAI's official API endpoint.

Setting custom endpoint can solve the problem of Chinese users not being able to directly access OpenAI's official API endpoint.
@anc95
Copy link
Owner

anc95 commented May 10, 2023

@qihangnet Could you please tell me why you are unable to access the OpenAI endpoint in China? Have you hosted your app on a cloud machine in China? Also, thank you for your PR.

@qihangnet
Copy link
Contributor Author

@anc95 看你应该可以用中文,我用中文解释一下。
目前存在以下场景:

  • OpenAI 官方对一些IP地址(不只是中国)访问存在某种规则的限制,可能需要代理或者一些反向代理机制;
  • 一些企业因为一些内部安全政策原因,允许访问微软 Azure 的 OpenAI 服务,而不允许直接访问 OpenAI 官方的 EndPoint。可以通过类似 https://github.com/diemus/azure-openai-proxy 这样的库做自定义的 EndPoint,而GPT应用本身不需要大规模修改API访问逻辑,只修改 EndPoint 地址就行。
  • 有时候需要在自有的环境中,运行 action,而不一定是 Github 自身的 Action runner 中

综上原因,我才提交这样一个简单的 PR,来适配以上情况下的场景仍然可以使用这个项目来解决开发。

@qihangnet
Copy link
Contributor Author

我再补充一下一句:你可以看一下 https://github.com/nektos/act 这个库,就知道我说的场景了

@anc95
Copy link
Owner

anc95 commented May 13, 2023

理解了哈哈,我原本想的是都是在 Github 的机器上跑 action,应该不会有网络问题,谢谢解释 和 PR

@anc95 anc95 merged commit 45ce6b0 into anc95:main May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants