atlasbot: extract hottest facts from segment lines
This commit is contained in:
parent
7029aa2beb
commit
774fb24296
@ -1204,7 +1204,18 @@ def _extract_hottest_facts(lines: list[str], question: str) -> list[str]:
|
||||
return []
|
||||
if "node" not in lowered and "nodes" not in lowered:
|
||||
return []
|
||||
line = next((item for item in lines if item.lower().startswith("hottest:")), "")
|
||||
line = ""
|
||||
for item in lines:
|
||||
if item.lower().startswith("hottest:"):
|
||||
line = item
|
||||
break
|
||||
if " | " in item:
|
||||
for seg in [seg.strip() for seg in item.split(" | ")]:
|
||||
if seg.lower().startswith("hottest:"):
|
||||
line = seg
|
||||
break
|
||||
if line:
|
||||
break
|
||||
if not line:
|
||||
return []
|
||||
facts = _expand_hottest_line(line)
|
||||
@ -1291,11 +1302,16 @@ def _metric_candidate_lines(lines: list[str], keywords: list[str] | None, limit:
|
||||
"storagepressure",
|
||||
}
|
||||
candidates: list[str] = []
|
||||
expanded: list[str] = []
|
||||
for line in lines:
|
||||
if " | " in line:
|
||||
expanded.extend([seg.strip() for seg in line.split(" | ") if seg.strip()])
|
||||
expanded.append(line)
|
||||
for line in expanded:
|
||||
if line.lower().startswith("hottest:"):
|
||||
candidates.extend(_expand_hottest_line(line))
|
||||
break
|
||||
for line in lines:
|
||||
for line in expanded:
|
||||
line_lower = line.lower()
|
||||
if line_lower.startswith("lexicon_") or line_lower.startswith("units:"):
|
||||
continue
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user