atlasbot: trigger focus fix on missing data
This commit is contained in:
parent
81fa889a29
commit
384b8d96aa
@ -1704,6 +1704,19 @@ def _needs_focus_fix(question: str, reply: str, classify: dict[str, Any]) -> boo
|
|||||||
q_lower = (question or "").lower()
|
q_lower = (question or "").lower()
|
||||||
if classify.get("question_type") not in {"metric", "diagnostic"} and not re.search(r"\b(how many|list|count)\b", q_lower):
|
if classify.get("question_type") not in {"metric", "diagnostic"} and not re.search(r"\b(how many|list|count)\b", q_lower):
|
||||||
return False
|
return False
|
||||||
|
missing_markers = (
|
||||||
|
"does not provide",
|
||||||
|
"does not specify",
|
||||||
|
"not available",
|
||||||
|
"not provided",
|
||||||
|
"cannot determine",
|
||||||
|
"don't have",
|
||||||
|
"do not have",
|
||||||
|
"insufficient",
|
||||||
|
"no data",
|
||||||
|
)
|
||||||
|
if any(marker in reply.lower() for marker in missing_markers):
|
||||||
|
return True
|
||||||
if reply.count(".") <= 1:
|
if reply.count(".") <= 1:
|
||||||
return False
|
return False
|
||||||
extra_markers = ("for more", "if you need", "additional", "based on")
|
extra_markers = ("for more", "if you need", "additional", "based on")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user