diff options
Diffstat (limited to 'Omni')
| -rw-r--r-- | Omni/Agent/Telegram.hs | 36 | ||||
| -rw-r--r-- | Omni/Dev/Beryllium/Ava.nix | 3 |
2 files changed, 39 insertions, 0 deletions
diff --git a/Omni/Agent/Telegram.hs b/Omni/Agent/Telegram.hs index de84e49..0ebf4ca 100644 --- a/Omni/Agent/Telegram.hs +++ b/Omni/Agent/Telegram.hs @@ -81,6 +81,7 @@ import Data.Time.Format (defaultTimeLocale, formatTime) import Data.Time.LocalTime (getCurrentTimeZone) import qualified Network.HTTP.Client as HTTPClient import qualified Network.HTTP.Simple as HTTP +import qualified Omni.Agent.AuditLog as AuditLog import qualified Omni.Agent.Engine as Engine import qualified Omni.Agent.Memory as Memory import qualified Omni.Agent.Paths as Paths @@ -870,6 +871,18 @@ handleAuthorizedMessageContinued tgConfig provider engineCfg msg uid userName ch now <- getCurrentTime _ <- forkIO <| Memory.saveChatHistoryEntry chatId (Just uid) "user" (Just userName) userMessage now + _ <- + forkIO <| do + entry <- + AuditLog.mkLogEntry + (AuditLog.SessionId (tshow chatId)) + (AuditLog.AgentId "ava") + (Just userName) + AuditLog.UserMessage + (Aeson.String userMessage) + AuditLog.emptyMetadata + AuditLog.writeAvaLog entry + processEngagedMessage tgConfig provider engineCfg msg uid userName chatId userMessage conversationContext handleAuthorizedMessageBatch :: @@ -1005,6 +1018,18 @@ handleAuthorizedMessageBatch tgConfig provider engineCfg msg uid userName chatId now <- getCurrentTime _ <- forkIO <| Memory.saveChatHistoryEntry chatId (Just uid) "user" (Just userName) userMessage now + _ <- + forkIO <| do + entry <- + AuditLog.mkLogEntry + (AuditLog.SessionId (tshow chatId)) + (AuditLog.AgentId "ava") + (Just userName) + AuditLog.UserMessage + (Aeson.String userMessage) + AuditLog.emptyMetadata + AuditLog.writeAvaLog entry + processEngagedMessage tgConfig provider engineCfg msg uid userName chatId userMessage conversationContext processEngagedMessage :: @@ -1221,6 +1246,17 @@ processEngagedMessage tgConfig provider engineCfg msg uid userName chatId userMe unless (Text.null response) <| do nowResp <- getCurrentTime _ <- forkIO <| Memory.saveChatHistoryEntry chatId (Just uid) "assistant" (Just "Ava") response nowResp + _ <- + forkIO <| do + entry <- + AuditLog.mkLogEntry + (AuditLog.SessionId (tshow chatId)) + (AuditLog.AgentId "ava") + Nothing + AuditLog.AssistantMessage + (Aeson.String response) + AuditLog.emptyMetadata + AuditLog.writeAvaLog entry pure () if Text.null response diff --git a/Omni/Dev/Beryllium/Ava.nix b/Omni/Dev/Beryllium/Ava.nix index 9abeb76..d732249 100644 --- a/Omni/Dev/Beryllium/Ava.nix +++ b/Omni/Dev/Beryllium/Ava.nix @@ -91,6 +91,9 @@ in { "d /home/ava/users 0755 ava users -" "d /home/ava/.local/share/omni 0755 ava users -" "d /home/ava/models 0755 ava users -" + "d /home/ava/logs 0755 ava users -" + "d /home/ava/logs/ava 0755 ava users -" + "d /home/ava/logs/subagents 0755 ava users -" ]; # Create .bashrc with direnv hook if it doesn't exist |
