acheong08/ChatGPT

[Bug]: v1 Setting up a proxy caused an error

2-3-5-7 opened this issue · 0 comments

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

change this line

self.session.proxies.update(proxies)

to self.session.proxies = proxies, fixed the error

Steps to reproduce the problem

from revChatGPT.V1 import Chatbot

chatbot = Chatbot(config={
    "access_token": "XXX",
    "paid": "False",
    "proxy": "127.0.0.1:7890"
})


def start_chat():
    print('Welcome to ChatGPT CLI')
    while True:
        prompt = input('> ')
        response = ""
        for data in chatbot.ask(prompt):
            response = data["message"]
            print(response)


if __name__ == "__main__":
    start_chat()

What should have happened?

No error

Version where the problem happens

5.3.2

What Python version are you running this with?

No response

What is your operating system ?

No response

Command Line Arguments

No

Console logs

Traceback (most recent call last):
  File "D:\Desktop\chat.py", line 3, in <module>
    chatbot = Chatbot(config={
              ^^^^^^^^^^^^^^^^
  File "D:\Desktop\venv\Lib\site-packages\revChatGPT\V1.py", line 65, in wrapper
    out = func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^
  File "D:\Desktop\venv\Lib\site-packages\revChatGPT\V1.py", line 158, in __init__
    self.session.proxies.update(proxies)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'update'

Additional information

No response