atlasbot: force hardware_usage_top for class metrics
This commit is contained in:
parent
164eab56fc
commit
5f433a186b
@ -285,6 +285,21 @@ class AnswerEngine:
|
|||||||
if hardware_facts:
|
if hardware_facts:
|
||||||
metric_facts = hardware_facts
|
metric_facts = hardware_facts
|
||||||
key_facts = _merge_fact_lines(metric_facts, key_facts)
|
key_facts = _merge_fact_lines(metric_facts, key_facts)
|
||||||
|
if classify.get("question_type") in {"metric", "diagnostic"}:
|
||||||
|
lowered_q = f"{question} {normalized}".lower()
|
||||||
|
if any(tok in lowered_q for tok in ("hardware", "class", "type", "rpi", "jetson", "amd64", "arm64")) and any(
|
||||||
|
tok in lowered_q for tok in ("average", "avg", "mean", "ram", "memory", "cpu", "load")
|
||||||
|
):
|
||||||
|
hw_top = None
|
||||||
|
for line in summary_lines:
|
||||||
|
if "hardware_usage_top:" in line:
|
||||||
|
parts = [seg.strip() for seg in line.split(" | ") if seg.strip().startswith("hardware_usage_top:")]
|
||||||
|
if parts:
|
||||||
|
hw_top = parts[0]
|
||||||
|
break
|
||||||
|
if hw_top:
|
||||||
|
metric_facts = [hw_top]
|
||||||
|
key_facts = _merge_fact_lines(metric_facts, key_facts)
|
||||||
if hottest_facts and not hardware_facts:
|
if hottest_facts and not hardware_facts:
|
||||||
metric_facts = hottest_facts
|
metric_facts = hottest_facts
|
||||||
key_facts = _merge_fact_lines(metric_facts, key_facts)
|
key_facts = _merge_fact_lines(metric_facts, key_facts)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user