Zai-Kun / reverse-engineered-chatgpt

Unofficial reverse-engineered ChatGPT API in Python
Apache License 2.0
240 stars 31 forks source link

There was a problem with your chat request. Please use a different browser or try again later. #36

Open krishna2206 opened 5 months ago

krishna2206 commented 5 months ago

Hello, I got this error when trying to get response from the API :

Exception in thread Thread-1 (send_message_and_print_response):
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/home/ubuntu/experiments/Python playground/reverse_chatgpt.py", line 19, in send_message_and_print_response
    for message in conversation.chat(prompt):
  File "/home/ubuntu/.local/lib/python3.10/site-packages/re_gpt/sync_chatgpt.py", line 135, in chat
    raise UnexpectedResponseError(error, server_response)
re_gpt.errors.UnexpectedResponseError: An unexpected error occurred. Error message: 'NoneType' object is not subscriptable.
This is what the server returned: {"detail":"There was a problem with your chat request. Please use a different browser or try again later."}.

This is the code :

with SyncChatGPT(session_token=session_token) as chatgpt:
    threads = []
    for i in range(1):
        t = threading.Thread(
            target=send_message_and_print_response,
            args=(chatgpt, messages[i], i+1))
        threads.append(t)
        t.start()

    for t in threads:
        t.join()

Any idea of what is happening here ?

skyrank7700 commented 5 months ago

getting the same error

Barrierml commented 5 months ago

PR alreay pushed, wait approved, you can use it at https://github.com/Barrierml/reverse-engineered-chatgpt

skyrank7700 commented 5 months ago

Thank You . Now it is working

skyrank7700 commented 5 months ago

can you make a explanation video of this code. I really want to understand this code.

AtulRajVAASITS commented 5 months ago

I have the same issue even after re install and i did the forked repo installation method

Barrierml commented 5 months ago

can you make a explanation video of this code. I really want to understand this code.

video? That might be a little difficult for me, if you have any specific problem, you can send to me

Barrierml commented 5 months ago

I have the same issue even after re install and i did the forked repo installation method

Have you tried other accounts? If other accounts still have the same problem, you can provide your environment

AtulRajVAASITS commented 5 months ago

it is fixed now Thank you

brizzbane commented 4 months ago

after trying the new version, now getting the 1st response, then immediately:

Traceback (most recent call last):
  File "/home/brizz/Code/createbook/async_basic_example.py", line 34, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.Traceback (most recent call last):
  File "/home/brizz/Code/createbook/async_basic_example.py", line 34, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/brizz/Code/createbook/async_basic_example.py", line 29, in main
    print(message_chunk["content"], flush=True, end="")
  File "/home/brizz/Code/createbook/.env/lib/python3.9/site-packages/re_gpt-3.0.2-py3.9.egg/re_gpt/async_chatgpt.py", line 439, in __aexit__
    await self.session.close()
TypeError: object NoneType can't be used in 'await' expression9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/brizz/Code/createbook/async_basic_example.py", line 29, in main
    print(message_chunk["content"], flush=True, end="")
  File "/home/brizz/Code/createbook/.env/lib/python3.9/site-packages/re_gpt-3.0.2-py3.9.egg/re_gpt/async_chatgpt.py", line 439, in __aexit__
    await self.session.close()
TypeError: object NoneType can't be used in 'await' expression
Barrierml commented 4 months ago

after trying the new version, now getting the 1st response, then immediately:

Traceback (most recent call last):
  File "/home/brizz/Code/createbook/async_basic_example.py", line 34, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.Traceback (most recent call last):
  File "/home/brizz/Code/createbook/async_basic_example.py", line 34, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/brizz/Code/createbook/async_basic_example.py", line 29, in main
    print(message_chunk["content"], flush=True, end="")
  File "/home/brizz/Code/createbook/.env/lib/python3.9/site-packages/re_gpt-3.0.2-py3.9.egg/re_gpt/async_chatgpt.py", line 439, in __aexit__
    await self.session.close()
TypeError: object NoneType can't be used in 'await' expression9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/brizz/Code/createbook/async_basic_example.py", line 29, in main
    print(message_chunk["content"], flush=True, end="")
  File "/home/brizz/Code/createbook/.env/lib/python3.9/site-packages/re_gpt-3.0.2-py3.9.egg/re_gpt/async_chatgpt.py", line 439, in __aexit__
    await self.session.close()
TypeError: object NoneType can't be used in 'await' expression

My bad, I will fix it