diff options
| author | Ben Sima <ben@bensima.com> | 2025-12-12 20:42:30 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-12-12 20:42:30 -0500 |
| commit | fd1c5c2bda7831c6cf329f4dc272064a352609e1 (patch) | |
| tree | fc2b28901955189ba15777b0e2fc4eccac7fe103 /Omni/Agent/Telegram.hs | |
| parent | a9d7f9434b370f4dd79ac40c606c91d3e3d9716b (diff) | |
Add sender_name to conversation messages for group chat support
- Add sender_name column to conversation_messages table
- Migrate existing messages to set sender_name='bensima'
- Show sender names in conversation context (e.g., 'bensima: hello')
- Pass userName when saving user messages in Telegram bot
Diffstat (limited to 'Omni/Agent/Telegram.hs')
| -rw-r--r-- | Omni/Agent/Telegram.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Omni/Agent/Telegram.hs b/Omni/Agent/Telegram.hs index b28405e..9142b4a 100644 --- a/Omni/Agent/Telegram.hs +++ b/Omni/Agent/Telegram.hs @@ -659,7 +659,7 @@ handleAuthorizedMessage tgConfig provider engineCfg msg uid userName chatId = do in prefix <> pdfText Nothing -> tmText msg - _ <- Memory.saveMessage uid chatId Memory.UserRole userMessage + _ <- Memory.saveMessage uid chatId Memory.UserRole (Just userName) userMessage (conversationContext, contextTokens) <- Memory.getConversationContext uid chatId maxConversationTokens putText <| "Conversation context: " <> tshow contextTokens <> " tokens" @@ -725,7 +725,7 @@ handleAuthorizedMessage tgConfig provider engineCfg msg uid userName chatId = do let response = Engine.resultFinalMessage agentResult putText <| "Response text: " <> Text.take 200 response - _ <- Memory.saveMessage uid chatId Memory.AssistantRole response + _ <- Memory.saveMessage uid chatId Memory.AssistantRole Nothing response if Text.null response then do |
