mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-09 08:22:19 +02:00
route current events through bounded news search
This commit is contained in:
@@ -232,7 +232,10 @@ class WebSearchTool:
|
||||
query = raw.split("\n")[0].strip()
|
||||
if time_filter is None:
|
||||
q_lc = query.lower()
|
||||
if any(kw in q_lc for kw in ("today", "latest", "breaking", "this morning", "right now", "currently")):
|
||||
if any(kw in q_lc for kw in (
|
||||
"today", "latest", "breaking", "this morning", "right now",
|
||||
"currently", "current events", "what's happening", "what is happening",
|
||||
)):
|
||||
time_filter = "day"
|
||||
elif any(kw in q_lc for kw in ("this week", "past week", "recent news", "last few days")):
|
||||
time_filter = "week"
|
||||
|
||||
@@ -4447,9 +4447,10 @@ async def stream_preview(*, endpoint_url, model, messages, headers, turn_contrac
|
||||
)
|
||||
if tool_type == 'web_search':
|
||||
web_search_attempts += 1
|
||||
if web_search_attempts > 4:
|
||||
if not native_workspace_enabled and web_search_attempts > 4:
|
||||
suppressed_tool_until_round['web_search'] = round_limit + 1
|
||||
force_no_tools_next_round = True
|
||||
terminal_budget_violation = True
|
||||
calls += 1
|
||||
raise ValueError(
|
||||
'The bounded search-attempt budget is exhausted. Do not search '
|
||||
|
||||
Reference in New Issue
Block a user