openai-cli icon indicating copy to clipboard operation
openai-cli copied to clipboard

Added proxy option

Open Khang5687 opened this issue 2 years ago • 5 comments

I added the option to specify proxies so that OpenAI API can be accessed through proxy. Please have a look!

Khang5687 avatar Jan 15 '23 15:01 Khang5687

Have you tried using HTTPS_PROXY env var, as documented here: https://requests.readthedocs.io/en/latest/user/advanced/#proxies? This should work out of the box

peterdemin avatar Jan 15 '23 16:01 peterdemin

I think it would be beneficial for Windows users as they can specify proxy with --proxy option instead of manually adding an environment variable in Windows settings.

Khang5687 avatar Jan 15 '23 17:01 Khang5687

I see. Sounds good. Let's remove mentions of OPENAI_PROXY_SERVER and rely on standard HTTP_PROXY.

peterdemin avatar Jan 27 '23 00:01 peterdemin

I have changed in accordance to your wish, please have a thorough check if there should be any errors in my codes :)

Khang5687 avatar Feb 16 '23 06:02 Khang5687

I fixed an error in cli.py. For some reasons, git didn't push my fixed code, I had to update it directly through github. Please have a look :)

Khang5687 avatar Feb 22 '23 07:02 Khang5687