Closed kroschu closed 1 year ago
How about !chat
command?
2023-05-20 09:38:15,079 - INFO - Login via password
2023-05-20 09:39:16,475 - INFO - Message received in room treba.m-e.pp.ua comment section ()
root | !chat Чому земля кругла?
Task exception was never retrieved
future: <Task finished name='Task-25' coro=<Bot.chat() done, defined at /app/bot.py:516> exception=Exception(JSONDecodeError('Expecting value: line 1 column 1 (char 0)'))>
Traceback (most recent call last):
File "/app/bot.py", line 520, in chat
text = await self.chatbot.ask_async(prompt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/v3.py", line 303, in ask_async
full_response: str = "".join([r async for r in response])
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/v3.py", line 303, in
Can you verify your openai api token is valid? How do you deploy the project? Can you paste your config file here without sensitive info?
Code in docker-compose.yml:
matrix_chatgpt_bots: image: hibobmaster/matrixchatgptbot:latest container_name: matrix_chatgpt_bot restart: always env_file: "./dev-environment/gpt.env"
config file:
HOMESERVER="https://xxxxx" USER_ID="@chatgpt:xxxxx" PASSWORD="xxxxxxxxxx" DEVICE_ID="NREENHDAAA" OPENAI_API_KEY="sk-lbh3mrxxxxxxxxxxxxxxxx" MARKDOWN_FORMATTED="true"
Can you verify your openai api token is valid?
sk-lbh3mrx2zeMHAJwqtR3NT3xxxxxxxxxxxxxxxxxxxxxx
Besides, do not use env file and config.json at the same time.
I just generated a new token and checked its validity. I made the changes in gpt.env :
HOMESERVER="https://xxxxxxxxxx" USER_ID="@cxxxxxxx" PASSWORD="xxxxxxxxxxxo" DEVICE_ID="NREENHDAAA" OPENAI_API_KEY="skxxxxxxxxxxxxxxxxxxxxxxx" MARKDOWN_FORMATTED="true"
Restart container in portainer web interface:
2023-05-20 10:00:14,321 - INFO - matrix chatgpt bot start..... 2023-05-20 10:00:14,489 - INFO - Login via password 2023-05-20 10:00:25,969 - INFO - Message received in room treba.m-e.pp.ua comment section () root | !gpt Чому земля кругла? 2023-05-20 10:00:26,506 - oneTimeAsk - WARNING - Too Many Requests 2023-05-20 10:00:26,506 - WARNING - Too Many Requests 2023-05-20 10:00:29,100 - oneTimeAsk - WARNING - Too Many Requests 2023-05-20 10:00:29,100 - WARNING - Too Many Requests 2023-05-20 10:00:31,102 - gpt - ERROR - Error: 'NoneType' object has no attribute 'strip' Traceback (most recent call last): File "/app/bot.py", line 551, in gpt text = text.strip() ^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'strip' 2023-05-20 10:00:31,102 - ERROR - Error: 'NoneType' object has no attribute 'strip' Traceback (most recent call last): File "/app/bot.py", line 551, in gpt text = text.strip() ^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'strip'
In result
Too Many Requests
means you exceed openai rete limit.
Free account: 3r/min
AttributeError: 'NoneType' object has no attribute 'strip' means you did not get the response from chatgpt.
Understood, thank you very much for your attention and time
After entering the query !gpt Чому земля кругла?
File "/app/bot.py", line 551, in gpt text = text.strip() ^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'strip' 2023-05-20 08:01:07,371 - ERROR - Error: 'NoneType' object has no attribute 'strip' Traceback (most recent call last): File "/app/bot.py", line 551, in gpt text = text.strip() ^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'strip'