acheong08 / Bard

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

feat: add session and timeout args #37

Closed dsdanielpark closed 1 year ago

dsdanielpark commented 1 year ago
  1. Specify the timeout as an argument for session.post. Instead of hard-coding it to 120, you can make it more flexible.
  2. Use the proxy argument for both post and get requests. However, since proxies is the official parameter name in the session, I suggest changing proxy to proxies.
  3. Additionally, some timeout arguments are hard-coded to 10, which may cause errors in environments where the timeout exceeds 10 seconds. I recommend passing the maximum timeout as an argument, but I haven't made that change.
  4. If you reuse the session, you can reuse the existing session object and avoid unnecessary authentication steps.
  5. I removed an unnecessary line of code from the authentication process that was modified in the previous pull request.