atlasbot: prioritize top queries over list
This commit is contained in:
parent
0331e7ea99
commit
270dc93966
@ -335,7 +335,11 @@ def _has_any(text: str, phrases: tuple[str, ...]) -> bool:
|
||||
return any(p in text for p in phrases)
|
||||
|
||||
def _detect_operation(q: str) -> str | None:
|
||||
if _has_any(q, OPERATION_HINTS["top"]):
|
||||
return "top"
|
||||
for op, phrases in OPERATION_HINTS.items():
|
||||
if op == "top":
|
||||
continue
|
||||
if _has_any(q, phrases):
|
||||
return op
|
||||
return None
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user