atlasbot: parse hardware usage from composite lines
This commit is contained in:
parent
80da274eaa
commit
7f4956edf1
@ -1062,10 +1062,12 @@ def _extract_hardware_usage_facts(lines: list[str], question: str) -> list[str]:
|
|||||||
avg_line = None
|
avg_line = None
|
||||||
top_line = None
|
top_line = None
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if line.startswith("hardware_usage_avg:"):
|
segments = [seg.strip() for seg in line.split(" | ")] if " | " in line else [line]
|
||||||
avg_line = line
|
for seg in segments:
|
||||||
elif line.startswith("hardware_usage_top:"):
|
if seg.startswith("hardware_usage_avg:"):
|
||||||
top_line = line
|
avg_line = seg
|
||||||
|
elif seg.startswith("hardware_usage_top:"):
|
||||||
|
top_line = seg
|
||||||
if not avg_line and not top_line:
|
if not avg_line and not top_line:
|
||||||
return []
|
return []
|
||||||
wants_top = any(term in lowered for term in ("highest", "lowest", "most", "least", "top", "worst", "best"))
|
wants_top = any(term in lowered for term in ("highest", "lowest", "most", "least", "top", "worst", "best"))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user