atlasbot: fix metric detection and role counts
This commit is contained in:
parent
70feb1ef85
commit
31fbe48ca3
@ -424,9 +424,14 @@ def _detect_operation(q: str) -> str | None:
|
||||
return None
|
||||
|
||||
def _detect_metric(q: str) -> str | None:
|
||||
tokens = set(_tokens(q))
|
||||
for metric, phrases in METRIC_HINTS.items():
|
||||
if _has_any(q, phrases):
|
||||
return metric
|
||||
for phrase in phrases:
|
||||
if " " in phrase:
|
||||
if phrase in q:
|
||||
return metric
|
||||
elif phrase in tokens:
|
||||
return metric
|
||||
return None
|
||||
|
||||
def _detect_hardware_filters(q: str) -> tuple[set[str], set[str]]:
|
||||
@ -1249,7 +1254,7 @@ def structured_answer(
|
||||
if missing:
|
||||
msg += f" Missing: {', '.join(missing)}."
|
||||
return _format_confidence(msg, "high")
|
||||
if not (include_hw or exclude_hw or nodes_in_query or only_workers):
|
||||
if not (include_hw or exclude_hw or nodes_in_query or only_workers or role_filters):
|
||||
return _format_confidence(f"Atlas has {len(names)} nodes.", "high")
|
||||
return _format_confidence(f"Matching nodes: {len(names)}.", "high")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user