Closed xiongbb closed 1 year ago
openai-python 使用的是request做请求,魔改一下就能实现了
[image: image.png] 有环境变量的,哥哥们
On Sat, Mar 25, 2023 at 12:50 PM DanielStones @.***> wrote:
openai-python 使用的是request做请求,魔改一下就能实现了
— Reply to this email directly, view it on GitHub https://github.com/WongSaang/chatgpt-ui/issues/74#issuecomment-1483722901, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALAX6FFRNU5ML3G2BEDOP4TW5Z2RHANCNFSM6AAAAAAWHGOXNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f16344263e0>: Failed to establish a new connection: [Errno 111] Connection refused'))
默认的环境变量里面没有OPEN_API_PROXY,手动添加后,执行出来 是这个效果。 估计是后来的代码变了,不知道在哪里调整
Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f16344263e0>: Failed to establish a new connection: [Errno 111] Connection refused'))
默认的环境变量里面没有OPEN_API_PROXY,手动添加后,执行出来 是这个效果。 估计是后来的代码变了,不知道在哪里调整
是我重新安装后覆盖了配置,但到目前为止还没有架设成功。用自己的接口,别的平台已经可以了。
格式:
OPENAI_API_PROXY=https://proxy.openai.com/v1
注意后面的 v1
OPENAI_API_PROXY 没有用, 实测要用 HTTP_PROXY 和 HTTPS_PROXY 还要用NO_PROXY 避免本地也被代理
OPENAI_API_PROXY 没有用, 实测要用 HTTP_PROXY 和 HTTPS_PROXY 还要用NO_PROXY 避免本地也被代理
OPENAI_API_PROXY 需要搭建一个 openai 的代理服务哦
原因你懂的