mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 10:15:27 -04:00
fix(agent): detect Polish web lookup intent (#4091)
This commit is contained in:
@@ -793,6 +793,12 @@ def _classify_agent_request(messages: List[Dict], last_user: str) -> Dict[str, o
|
|||||||
domains.add("documents")
|
domains.add("documents")
|
||||||
if has(r"\b(search|web|google|look up|latest|news|current|weather|forecast|stock price|price of|website|url|https?://|www\.)\b"):
|
if has(r"\b(search|web|google|look up|latest|news|current|weather|forecast|stock price|price of|website|url|https?://|www\.)\b"):
|
||||||
domains.add("web")
|
domains.add("web")
|
||||||
|
if has(
|
||||||
|
r"\b(wyszukaj|wyszukać|wyszukac)\b.*\b(internet|internecie|online|web)\b",
|
||||||
|
r"\b(sprawd[zź]|znajd[zź])\b.*\b(internet|internecie|online|web)\b",
|
||||||
|
r"\b(aktualn\w*|bieżąc\w*|biezac\w*|dzisiaj|teraz)\b.*\b(pogod\w*|temperatur\w*)\b",
|
||||||
|
):
|
||||||
|
domains.add("web")
|
||||||
if has(r"\b(research|deep dive|investigate|look into)\b"):
|
if has(r"\b(research|deep dive|investigate|look into)\b"):
|
||||||
domains.add("web")
|
domains.add("web")
|
||||||
if has(r"\b(open|show|toggle|turn on|turn off|disable|enable|switch model|change model|settings|theme|panel)\b"):
|
if has(r"\b(open|show|toggle|turn on|turn off|disable|enable|switch model|change model|settings|theme|panel)\b"):
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ _IMPORTED_AGENT_LOOP = None
|
|||||||
try:
|
try:
|
||||||
from src.agent_loop import (
|
from src.agent_loop import (
|
||||||
_detect_admin_intent,
|
_detect_admin_intent,
|
||||||
|
_classify_agent_request,
|
||||||
_compute_final_metrics,
|
_compute_final_metrics,
|
||||||
_append_tool_results,
|
_append_tool_results,
|
||||||
_MCP_KEYWORDS,
|
_MCP_KEYWORDS,
|
||||||
@@ -62,6 +63,16 @@ def test_mcp_keyword_gate_matches_literal_mcp_requests():
|
|||||||
assert "mcp" in _MCP_KEYWORDS
|
assert "mcp" in _MCP_KEYWORDS
|
||||||
|
|
||||||
|
|
||||||
|
def test_polish_internet_search_request_classifies_as_web():
|
||||||
|
intent = _classify_agent_request(
|
||||||
|
[],
|
||||||
|
"Wyszukaj w internecie i podaj temperaturę w Lubartowie dzisiaj",
|
||||||
|
)
|
||||||
|
|
||||||
|
assert intent["low_signal"] is False
|
||||||
|
assert "web" in intent["domains"]
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# _detect_admin_intent
|
# _detect_admin_intent
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user