From 817bdb1f33e9825946a2da2aa1ff8f91b6166366 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 12 Dec 2025 23:30:04 -0500 Subject: telegram bot: refactor + multimedia + reply support Refactor Telegram.hs into submodules to reduce file size: - Types.hs: data types, JSON parsing - Media.hs: file downloads, image/voice analysis - Reminders.hs: reminder loop, user chat persistence Multimedia improvements: - Vision uses third-person to avoid LLM confusion - Better message framing for embedded descriptions - Size validation (10MB images, 20MB voice) - MIME type validation for voice messages New features: - Reply support: bot sees context when users reply - Web search: default 5->10, max 10->20 results - Guardrails: duplicate tool limit 3->10 for research - Timezone: todos parse/display in Eastern time (ET) --- Omni/Agent/Tools/WebSearch.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Omni/Agent/Tools/WebSearch.hs') diff --git a/Omni/Agent/Tools/WebSearch.hs b/Omni/Agent/Tools/WebSearch.hs index f7250b8..58c945c 100644 --- a/Omni/Agent/Tools/WebSearch.hs +++ b/Omni/Agent/Tools/WebSearch.hs @@ -172,7 +172,7 @@ webSearchTool apiKey = "limit" .= Aeson.object [ "type" .= ("integer" :: Text), - "description" .= ("Max results to return (default: 5, max: 10)" :: Text) + "description" .= ("Max results to return (default: 10, max: 20)" :: Text) ] ], "required" .= (["query"] :: [Text]) @@ -185,7 +185,7 @@ executeWebSearch apiKey v = case Aeson.fromJSON v of Aeson.Error e -> pure (Aeson.object ["error" .= Text.pack e]) Aeson.Success (args :: WebSearchArgs) -> do - let lim = min 10 (max 1 (wsLimit args)) + let lim = min 20 (max 1 (wsLimit args)) result <- kagiSearch apiKey (wsQuery args) lim case result of Left err -> @@ -209,4 +209,4 @@ instance Aeson.FromJSON WebSearchArgs where parseJSON = Aeson.withObject "WebSearchArgs" <| \v -> (WebSearchArgs (v Aeson..:? "limit" Aeson..!= 5) + <*> (v Aeson..:? "limit" Aeson..!= 10) -- cgit v1.2.3