summaryrefslogtreecommitdiff
path: root/Omni/Agent/Tools/WebSearch.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-12-12 23:30:04 -0500
committerBen Sima <ben@bensima.com>2025-12-12 23:30:04 -0500
commit817bdb1f33e9825946a2da2aa1ff8f91b6166366 (patch)
tree32af363a03de72964e999ce437a7e01bfc80a85a /Omni/Agent/Tools/WebSearch.hs
parentbfa50a5a755e13c0ee2394d89280092a639d8f0d (diff)
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)
Diffstat (limited to 'Omni/Agent/Tools/WebSearch.hs')
-rw-r--r--Omni/Agent/Tools/WebSearch.hs6
1 files changed, 3 insertions, 3 deletions
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..: "query"))
- <*> (v Aeson..:? "limit" Aeson..!= 5)
+ <*> (v Aeson..:? "limit" Aeson..!= 10)