atlasbot: enforce metric facts after evidence fix

This commit is contained in:
Brad Stein 2026-02-03 17:25:52 -03:00
parent e07e3c785f
commit b91f3e72aa

View File

@ -535,6 +535,24 @@ class AnswerEngine:
model=plan.model, model=plan.model,
tag="evidence_fix", tag="evidence_fix",
) )
if metric_facts and not _reply_matches_metric_facts(reply, metric_facts):
enforce_prompt = (
prompts.EVIDENCE_FIX_PROMPT
+ "\nQuestion: "
+ normalized
+ "\nDraft: "
+ reply
+ "\nMustIncludeFacts: "
+ "; ".join(metric_facts[:6])
+ "\nInstruction: The answer must include all MustIncludeFacts items."
)
reply = await call_llm(
prompts.EVIDENCE_FIX_SYSTEM,
enforce_prompt,
context=context,
model=plan.model,
tag="evidence_fix_enforce",
)
if "raspberry" in lowered_question and "not" in lowered_question: if "raspberry" in lowered_question and "not" in lowered_question:
non_rpi = _non_rpi_nodes(summary) non_rpi = _non_rpi_nodes(summary)