atlasbot: strip follow-up meta phrasing
This commit is contained in:
parent
9d495b4f1e
commit
4d15bdd466
@ -801,8 +801,29 @@ class AnswerEngine:
|
||||
tag="followup_fix",
|
||||
)
|
||||
reply = await self._dedup_reply(reply, plan, call_llm, tag="dedup_followup")
|
||||
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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user