Zero6992 / chatGPT-discord-bot

Integrate ChatGPT into your own discord bot
GNU General Public License v2.0
2.6k stars 699 forks source link

Update requirements.txt #447

Closed dtpfl closed 3 months ago

dtpfl commented 11 months ago

Since a few days the bot wasn't working. Updating revChatGPT fixed the issue.

2023-07-23 17:27:31 ERROR    src.log -> Error while sending system prompt: object str can't be used in 'await' expression
Traceback (most recent call last):
  File "x\chatGPT-discord-bot\src\aclient.py", line 136, in send_start_prompt
    response = f"{response}{await responses.unofficial_handle_response(self.starting_prompt, self)}"
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xchatGPT-discord-bot\src\responses.py", line 12, in unofficial_handle_response
    responseMessage = await response["message"]
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object str can't be used in 'await' expression
PS xchatGPT-discord-bot>  c:; cd 'xchatGPT-discord-bot'; & 'C:\Users\x\AppData\Local\Microsoft\WindowsApps\python3.11.exe' 'C:\Users\x\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '53100' '--' 'xchatGPT-discord-bot\main.py' 
Setting PUID (You are a Plus user!): user-xxxx:xxxxx
2023-07-23 17:28:20 INFO     discord.client logging in using static token
2023-07-23 17:28:21 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: xxx).
2023-07-23 17:28:23 INFO     src.log -> Send system prompt with size 11
2023-07-23 17:28:32 ERROR    src.log -> Error while sending system prompt: Field missing. Details: {'conversation_id': 'xxxx', 'message_id': 'xxxx', 'is_completion': False, 'moderation_response': {'flagged': False, 'blocked': False, 'moderation_id': 'modr-xxxx'}}
Traceback (most recent call last):
  File "xchatGPT-discord-bot\src\aclient.py", line 136, in send_start_prompt
    response = f"{response}{await responses.unofficial_handle_response(self.starting_prompt, self)}"
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xchatGPT-discord-bot\src\responses.py", line 11, in unofficial_handle_response
    async for response in client.chatbot.ask(message):
  File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\revChatGPT\V1.py", line 1332, in ask
    async for msg in self.post_messages(
  File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\revChatGPT\V1.py", line 1283, in post_messages
    async for msg in self.__send_request(
  File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\revChatGPT\V1.py", line 1146, in __send_request
    raise ValueError(f"Field missing. Details: {str(line)}")
ValueError: Field missing. Details: {'conversation_id': 'xxxx', 'message_id': 'xxxx', 'is_completion': False, 'moderation_response': {'flagged': False, 'blocked': False, 'moderation_id': 'modr-xxxx'}}
dtpfl commented 11 months ago

This will fix https://github.com/Zero6992/chatGPT-discord-bot/issues/445

AndrewsPanda commented 11 months ago

This will fix #445

I have updated to revChatGPT==6.8.6 and I am getting the following error:

Discord return error:

ERROR: Something went wrong, please try again later! 

ERROR MESSAGE: OpenAI: {"error":"Post \"https://tcr9i.chat.openai.com/fc/gt2/public_key/35536E1E-65B4-4D96-9D97-6ADB7EFF8147\": http2: server sent GOAWAY and closed the connection; LastStreamID=1, ErrCode=ENHANCE_YOUR_CALM, debug=\"\""} (code: 500)

Terminal Return error:


2023-08-01 08:14:26 ERROR    src.log -> Error while sending : OpenAI: {"error":"Post \"https://tcr9i.chat.openai.com/fc/gt2/public_key/35536E1E-65B4-4D96-9D97-6ADB7EFF8147\": http2: server sent GOAWAY and closed the connection; LastStreamID=1, ErrCode=ENHANCE_YOUR_CALM, debug=\"\""} (code: 500)
Traceback (most recent call last):
  File "E:\A1Projects\TEST\.venv\Lib\site-packages\revChatGPT\V1.py", line 1548, in __check_response
    response.raise_for_status()
  File "E:\A1Projects\TEST\.venv\Lib\site-packages\httpx\_models.py", line 749, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'https://bypass.churchless.tech/conversation'
For more information check: https://httpstatuses.com/500

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "E:\A1Projects\TEST\src\aclient.py", line 113, in send_message
    response = f"{response}{await responses.unofficial_handle_response(user_message, self)}"
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\A1Projects\TEST\src\responses.py", line 11, in unofficial_handle_response
    async for response in client.chatbot.ask(message):
  File "E:\A1Projects\TEST\.venv\Lib\site-packages\revChatGPT\V1.py", line 1331, in ask
    async for msg in self.post_messages(
  File "E:\A1Projects\TEST\.venv\Lib\site-packages\revChatGPT\V1.py", line 1282, in post_messages
    async for msg in self.__send_request(
  File "E:\A1Projects\TEST\.venv\Lib\site-packages\revChatGPT\V1.py", line 1120, in __send_request
    await self.__check_response(response)
  File "E:\A1Projects\TEST\.venv\Lib\site-packages\revChatGPT\V1.py", line 1556, in __check_response
    raise error from ex
revChatGPT.typings.Error: OpenAI: {"error":"Post \"https://tcr9i.chat.openai.com/fc/gt2/public_key/35536E1E-65B4-4D96-9D97-6ADB7EFF8147\": http2: server sent GOAWAY and closed the connection; LastStreamID=1, ErrCode=ENHANCE_YOUR_CALM, debug=\"\""} (code: 500)
Please check that the input is correct, or you can resolve this issue by filing an issue
Project URL: https://github.com/acheong08/ChatGPT
patmONE commented 10 months ago

I am having the same error, was this issue resolved?