Skip to content

Commit

Permalink
feat(Inline Updates): Introducing inline updates for questions and an…
Browse files Browse the repository at this point in the history
…swers.
  • Loading branch information
frostaura committed Jan 30, 2024
1 parent edc586a commit 885802d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
src/data/photo_*.png
src/data/voicenote_*.mp3
src/FrostAura.Intelligence.Iluvatar.Telegram/appsettings.development.json
**/.vs/**
**/.vs/**
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ private async Task OnMessageAsync(ITelegramBotClient bot, Update update, Cancell
{
_logger.LogInformation($"[{this.GetType().Name}][{senderFullName}] processing query: {message?.Text}.");

if(!_conversations.ContainsKey(senderId))
var botResponseMessage = await bot.SendTextMessageAsync(update.Message.Chat.Id, "Thinking...".MarkdownV2Escape(), parseMode: ParseMode.MarkdownV2, replyToMessageId: update.Message.MessageId);

if (!_conversations.ContainsKey(senderId))
{
_conversations[senderId] = await _llmSkill.ChatAsync(message?.Text, ModelType.LargeLLM, token);
}
Expand All @@ -189,7 +191,7 @@ private async Task OnMessageAsync(ITelegramBotClient bot, Update update, Cancell
await _conversations[senderId].ChatAsync(message?.Text, token);
}

await bot.SendTextMessageAsync(update.Message.Chat.Id, _conversations[senderId].LastMessage.MarkdownV2Escape(), parseMode: ParseMode.MarkdownV2, replyToMessageId: update.Message.MessageId);
await bot.EditMessageTextAsync(update.Message.Chat.Id, botResponseMessage.MessageId, _conversations[senderId].LastMessage.MarkdownV2Escape(), parseMode: ParseMode.MarkdownV2);
}
}

Expand Down

0 comments on commit 885802d

Please sign in to comment.