mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-06 06:52:20 +02:00
preserve manual formats and require discovery for evidence requests
This commit is contained in:
@@ -3441,7 +3441,7 @@ def preserve_requested_web_recency(name, args, *, user_text='', prior_search_int
|
||||
query = f'{query} site:{domains[0]}'
|
||||
if (
|
||||
re.search(r'\bofficial\b', user, re.I)
|
||||
and re.search(r'\b(?:manual|handbook|pdf)\b', user, re.I)
|
||||
and re.search(r'\bpdf\b', user, re.I)
|
||||
and not re.search(r'(?:filetype:pdf|\.pdf)\b', query, re.I)
|
||||
):
|
||||
query = f'{query} filetype:pdf'
|
||||
@@ -3912,7 +3912,9 @@ async def stream_preview(*, endpoint_url, model, messages, headers, turn_contrac
|
||||
budget_completion_attempted = False
|
||||
answer_recovery_attempts = 0
|
||||
force_no_tools_next_round = False
|
||||
force_web_search_next_round = False
|
||||
force_web_search_next_round = (
|
||||
broad_current_web_request(direct_user_text) and not native_workspace_enabled
|
||||
)
|
||||
force_private_browser_next_round = False
|
||||
suggestion_retry_required = False
|
||||
suggestion_retry_attempted = False
|
||||
|
||||
@@ -3991,6 +3991,8 @@ def broad_web_briefing_request(message: str) -> bool:
|
||||
return True
|
||||
if re.search(r"\b(?:research|investigate|deep[ -]?dive)\b", text, re.I):
|
||||
return True
|
||||
if re.search(r"\b(?:find|gather|look\s+for)\s+(?:supporting\s+)?evidence\b", text, re.I):
|
||||
return True
|
||||
if (
|
||||
re.search(r"\b(?:latest|recent|current|today(?:'s)?|right\s+now)\b", text, re.I)
|
||||
and re.search(
|
||||
|
||||
@@ -1987,14 +1987,19 @@ def test_missing_refinement_query_is_grounded_in_user_request():
|
||||
assert args['time_filter'] == 'day'
|
||||
|
||||
|
||||
def test_official_manual_search_requests_direct_pdf_results():
|
||||
def test_official_manual_does_not_invent_pdf_requirement():
|
||||
args = preserve_requested_web_recency(
|
||||
'web_search',
|
||||
{'query': 'WIKING Miro stove manual official source'},
|
||||
user_text='Find the official English WIKING Miro stove manual online.',
|
||||
)
|
||||
|
||||
assert args['query'].endswith('filetype:pdf')
|
||||
assert 'filetype:pdf' not in args['query']
|
||||
explicit = preserve_requested_web_recency(
|
||||
'web_search', {'query': 'camera manual'},
|
||||
user_text='Find the official camera manual PDF.',
|
||||
)
|
||||
assert explicit['query'].endswith('filetype:pdf')
|
||||
|
||||
|
||||
def test_unknown_official_domain_rejects_reseller_but_accepts_direct_document():
|
||||
|
||||
@@ -35,6 +35,7 @@ from src.turn_contract import (
|
||||
'latset ai neews?',
|
||||
'whats new in japan rn',
|
||||
'what’s new in Sweden',
|
||||
'Compare battery chemistries for home storage. Find evidence and explain tradeoffs.',
|
||||
])
|
||||
def test_broad_web_briefings_share_one_search_semantic(prompt):
|
||||
from src.turn_contract import broad_web_briefing_request
|
||||
|
||||
Reference in New Issue
Block a user