labteral / chatgpt-python

Unofficial Python SDK for OpenAI's ChatGPT
https://labteral.github.io/chatgpt-python/
GNU General Public License v3.0
523 stars 76 forks source link

How to use Proxy in the chatgpt-python? #5

Closed houzhong closed 1 year ago

houzhong commented 1 year ago

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.

wellcoming commented 1 year ago

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

brunneis commented 1 year ago

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>"