acheong08 / ChatGPT

Reverse engineered ChatGPT API
GNU General Public License v2.0
28.04k stars 4.48k forks source link

[BUG] TypeError: object async_generator can't be used in await expression #651

Closed FerdinandoPH closed 1 year ago

FerdinandoPH commented 1 year ago

Description I just ran the new example code for version 2.1.0, and this is what I get. I've tried it in two different computers, with no result

Steps to Reproduce

  1. Execute the code for V2 in README.md
  2. Get the error

Expected behavior The program gets the actual response

Output

D:\Users\perez\Documents\progra\web_2bach>python -u "d:\Users\perez\Documents\progra\web_2bach\web5\losingmysanitytest.py" Traceback (most recent call last): File "d:\Users\perez\Documents\progra\web_2bach\web5\losingmysanitytest.py", line 10, in asyncio.run(main()) File "C:\Users\perez\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Users\perez\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\perez\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 650, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "d:\Users\perez\Documents\progra\web_2bach\web5\losingmysanitytest.py", line 5, in main response =await chatbot.ask("Hello") ^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: object async_generator can't be used in 'await' expression

Environment revChatGPT-2.1.0 Windows 10 Python 3.11.2

acheong08 commented 1 year ago

Oops bad example. Will fix

acheong08 commented 1 year ago

Check new readme

FerdinandoPH commented 1 year ago

Ok, now pylint shows an error, but the program works great so no problem 👍