Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/wiesn_agent/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ def _classify_intent(text: str) -> str:
if lower in ("?", "??", "???"):
return "help"

# Question heuristic — check before stripping so the trailing "?" is still visible
trailing_question = lower.endswith("?")

# Strip punctuation for matching
clean = re.sub(r"[?.!,;:]+", " ", lower).strip()

Expand All @@ -489,7 +492,7 @@ def _classify_intent(text: str) -> str:
return intent

# 3. Question heuristics — if ending with "?" and no other match, show help
if clean.endswith("?"):
if trailing_question:
return "help"

return "unknown"
Expand Down
Loading
Loading