Проблема с Gemini API в Discord Bot (с использованием discord.py)Python

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 Проблема с Gemini API в Discord Bot (с использованием discord.py)

Сообщение Anonymous »


Alright so i have a discord ask command that's supposed to let the user ask any thing and take the input and give it to gemini through the API but it seems to keep returning 0 canidates. I included a try statement only incase the user asks something innapropriate but it seems like its always being used no matter what i ask. Heres the code:

# Bot command: Ask a question @bot.command() async def ask(ctx, *, question): if question == None: await ctx.send("**Please provide a question.**") return await ctx.send("**Generating Response...**") print(f"ques: {question}") response = model.generate_content(str(question)) try: await send_long_message(ctx, response.text) except ValueError: print(response.text) await ctx.send(f"There was an error. Prompt Feedback: {response.prompt_feedback}") Its not a problem with the send_long_message function

I tried removing the send_long_message function and adding/removing await but nothing seemed to work. Same problem. Sometimes a value error or sometimes a type error. It always returns 0 canidates.


Источник: https://stackoverflow.com/questions/781 ... discord-py
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»