labteral / chatgpt-python

Unofficial Python SDK for OpenAI's ChatGPT

Home Page:https://labteral.github.io/chatgpt-python/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use Proxy in the chatgpt-python?

houzhong opened this issue · comments

Some countries like China, Hk, They need proxy access to chatgpt
How to use a proxy in chatgpt-python like socks5, http proxy and so on.

image
Modify ***\chatgpt\chatgpt.py like this.

Hi @houzhong,

While this is not implemented in the code, you can try setting the following environment variables before using the library:

export HTTP_PROXY="http://<user>:<pass>@<proxy>:<port>"
export HTTPS_PROXY="http://<user>:<pass>@<proxy>:<port>"