atlasbot: fallback metric facts for hardware usage
This commit is contained in:
parent
e31cb74e14
commit
164eab56fc
@ -296,6 +296,18 @@ class AnswerEngine:
|
||||
key_facts = _merge_fact_lines(metric_facts, key_facts)
|
||||
if self._settings.debug_pipeline:
|
||||
_debug_log("metric_facts_selected", {"facts": metric_facts})
|
||||
if classify.get("question_type") in {"metric", "diagnostic"} and not metric_facts:
|
||||
for line in summary_lines:
|
||||
if "hardware_usage_top:" in line:
|
||||
metric_facts = [seg.strip() for seg in line.split(" | ") if seg.strip().startswith("hardware_usage_top:")]
|
||||
break
|
||||
if not metric_facts:
|
||||
for line in summary_lines:
|
||||
if "hardware_usage_avg:" in line:
|
||||
metric_facts = [seg.strip() for seg in line.split(" | ") if seg.strip().startswith("hardware_usage_avg:")]
|
||||
break
|
||||
if metric_facts:
|
||||
key_facts = _merge_fact_lines(metric_facts, key_facts)
|
||||
if self._settings.debug_pipeline:
|
||||
scored_preview = sorted(
|
||||
[{"id": c["id"], "score": scored.get(c["id"], 0.0), "summary": c["summary"]} for c in chunks],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user