diff --git a/atlasbot/engine/answerer.py b/atlasbot/engine/answerer.py index af7d92f..4cf52d8 100644 --- a/atlasbot/engine/answerer.py +++ b/atlasbot/engine/answerer.py @@ -804,26 +804,6 @@ class AnswerEngine: reply = _strip_followup_meta(reply) return reply - -def _strip_followup_meta(reply: str) -> str: - cleaned = reply.strip() - if not cleaned: - return cleaned - prefixes = [ - "The draft is correct based on the provided context.", - "The draft is correct based on the context.", - "The draft is correct based on the provided evidence.", - "The draft is correct.", - "Based on the provided context,", - "Based on the context,", - "Based on the provided evidence,", - ] - for prefix in prefixes: - if cleaned.lower().startswith(prefix.lower()): - cleaned = cleaned[len(prefix) :].lstrip(" .") - break - return cleaned - async def _select_claims( self, question: str, @@ -869,6 +849,26 @@ def _strip_followup_meta(reply: str) -> str: self._store.cleanup() +def _strip_followup_meta(reply: str) -> str: + cleaned = reply.strip() + if not cleaned: + return cleaned + prefixes = [ + "The draft is correct based on the provided context.", + "The draft is correct based on the context.", + "The draft is correct based on the provided evidence.", + "The draft is correct.", + "Based on the provided context,", + "Based on the context,", + "Based on the provided evidence,", + ] + for prefix in prefixes: + if cleaned.lower().startswith(prefix.lower()): + cleaned = cleaned[len(prefix) :].lstrip(" .") + break + return cleaned + + def _build_meta( mode: str, call_count: int,