Add thinking message for conversations

Kaveen Kumarasinghe 2 years ago
parent 6b5ad1bfb8
commit 2e4de119db

@ -30,7 +30,7 @@ from services.environment_service import EnvService
from models.openai_model import Model from models.openai_model import Model
__version__ = "9.0.3" __version__ = "9.0.4"
PID_FILE = Path("bot.pid") PID_FILE = Path("bot.pid")

@ -630,6 +630,14 @@ class TextService:
conversation_overrides["presence_penalty"], conversation_overrides["presence_penalty"],
) )
# Send an embed that tells the user that the bot is thinking
thinking_embed = discord.Embed(
title=f"🤖💬 Thinking...",
color=0x808080,
)
thinking_embed.set_footer(text="This may take a few seconds.")
thinking_message = await message.reply(embed=thinking_embed)
await TextService.encapsulated_send( await TextService.encapsulated_send(
converser_cog, converser_cog,
message.channel.id, message.channel.id,
@ -639,6 +647,10 @@ class TextService:
model=converser_cog.conversation_threads[message.channel.id].model, model=converser_cog.conversation_threads[message.channel.id].model,
custom_api_key=user_api_key, custom_api_key=user_api_key,
) )
# Delete the thinking embed
await thinking_message.delete()
return True return True
@staticmethod @staticmethod

Loading…
Cancel
Save