mishl-dev / Discord-AI-Chatbot

This Discord chatbot is incredibly versatile. Powered incredibly fast Groq API
GNU Affero General Public License v3.0
1.32k stars 417 forks source link

I tried to make a dev bot but it failed :( - Peter #153

Closed pedrotelesh closed 1 year ago

pedrotelesh commented 1 year ago
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.9/site-packages/discord/client.py", line 441, in _run_event
    await coro(*args, **kwargs)
  File "/home/container/main.py", line 156, in on_message
    response = await generate_response(instructions, search_results, image_caption, history)
  File "/home/container/utilities/ai_utils.py", line 71, in generate_response
    choices = response_data['choices']
KeyError: 'choices'

Yes, i'm using the main, i think it's because my instructions are too big

chris-ss commented 1 year ago

the same problem

IntrovertedFL commented 1 year ago

Same here


discordbot  | 2023-06-15 03:31:57 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: e8053ee754189de6fd7ac5fba8bb5047).
discordbot  | 2023-06-15 03:33:34 ERROR    discord.client Ignoring exception in on_message
discordbot  | Traceback (most recent call last):
discordbot  |   File "/usr/local/lib/python3.11/site-packages/discord/client.py", line 441, in _run_event
discordbot  |     await coro(*args, **kwargs)
discordbot  |   File "/app/main.py", line 141, in on_message
discordbot  |     response = await generate_response(instructions, search_results, image_caption, history)
discordbot  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
discordbot  |   File "/app/utilities/ai_utils.py", line 73, in generate_response
discordbot  |     choices = response_data['choices']
discordbot  |               ~~~~~~~~~~~~~^^^^^^^^^^^
discordbot  | KeyError: 'choices'``` 
Yerli-Oyuncu commented 1 year ago

same

GameOn2611 commented 1 year ago

Yes I am also getting same error

mishl-dev commented 1 year ago
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.9/site-packages/discord/client.py", line 441, in _run_event
    await coro(*args, **kwargs)
  File "/home/container/main.py", line 156, in on_message
    response = await generate_response(instructions, search_results, image_caption, history)
  File "/home/container/utilities/ai_utils.py", line 71, in generate_response
    choices = response_data['choices']
KeyError: 'choices'

Yes, i'm using the main, i think it's because my instructions are too big

Die