diff --git a/atlasbot/engine/answerer.py b/atlasbot/engine/answerer.py index 9892753..821a343 100644 --- a/atlasbot/engine/answerer.py +++ b/atlasbot/engine/answerer.py @@ -268,6 +268,19 @@ class AnswerEngine: key_facts = _key_fact_lines(summary_lines, keyword_tokens) hottest_facts = _extract_hottest_facts(summary_lines, f"{question} {normalized}") hardware_facts = _extract_hardware_usage_facts(summary_lines, f"{question} {normalized}") + if not hardware_facts: + hardware_tokens = ("hardware", "class", "type", "rpi", "jetson", "amd64", "arm64") + lowered_q = f"{question} {normalized}".lower() + if any(tok in lowered_q for tok in hardware_tokens): + for line in summary_lines: + if "hardware_usage_top:" in line: + hardware_facts = [seg.strip() for seg in line.split(" | ") if seg.strip().startswith("hardware_usage_top:")] + break + if not hardware_facts: + for line in summary_lines: + if "hardware_usage_avg:" in line: + hardware_facts = [seg.strip() for seg in line.split(" | ") if seg.strip().startswith("hardware_usage_avg:")] + break metric_facts = [line for line in key_facts if re.search(r"\d", line)] if hardware_facts: metric_facts = hardware_facts