acheong08 / Bard

Python SDK/API for reverse engineered Google Bard
MIT License
1.42k stars 178 forks source link

Add proxy option #6

Closed tylearymf closed 1 year ago

tylearymf commented 1 year ago

Could you add a "proxy" property in the Chatbot constructor like in ChatGPT and EdgeGPT?

acheong08 commented 1 year ago

export all_proxy="socks5://host:port"

tylearymf commented 1 year ago

But the proxy did not work when I used the following code. My environment is Python 3.10.

import os
os.environ['all_proxy'] = 'http://127.0.0.1:1080'

chatbot = ChatBot(xx,xx)
# proxy not working
chatbot.ask('')
tylearymf commented 1 year ago

I'm using the Process class in C# to start a Python process, like this:

System.Diagnostics.Process.Start("python.exe", "main.py");
tylearymf commented 1 year ago

I tried setting the environment variable before starting the Python process, and it worked for proxying.