diff --git a/atlasbot/engine/answerer.py b/atlasbot/engine/answerer.py index 03d2f0d..1568416 100644 --- a/atlasbot/engine/answerer.py +++ b/atlasbot/engine/answerer.py @@ -535,6 +535,24 @@ class AnswerEngine: model=plan.model, 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: non_rpi = _non_rpi_nodes(summary)