mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-07 23:42:21 +02:00
fix(agent): preserve tool evidence through final synthesis
This commit is contained in:
+5
-2
@@ -268,8 +268,11 @@ def _normalize_dsml(text: str) -> str:
|
||||
if "DSML" not in text:
|
||||
return text
|
||||
t = text
|
||||
t = re.sub(rf"<\s*{_DSML_PIPES}\s*DSML\s*{_DSML_PIPES}\s*tool_calls\s*>", "<tool_call>", t, flags=re.IGNORECASE)
|
||||
t = re.sub(rf"<\s*/\s*{_DSML_PIPES}\s*DSML\s*{_DSML_PIPES}\s*tool_calls\s*>", "</tool_call>", t, flags=re.IGNORECASE)
|
||||
# Hosted DeepSeek variants use both ``tool_calls`` and the shorter
|
||||
# ``calls`` wrapper. Treat them identically; otherwise the inner invoke is
|
||||
# parsed but the outer DSML tags leak into the user-visible response.
|
||||
t = re.sub(rf"<\s*{_DSML_PIPES}\s*DSML\s*{_DSML_PIPES}\s*(?:tool_calls|calls)\s*>", "<tool_call>", t, flags=re.IGNORECASE)
|
||||
t = re.sub(rf"<\s*/\s*{_DSML_PIPES}\s*DSML\s*{_DSML_PIPES}\s*(?:tool_calls|calls)\s*>", "</tool_call>", t, flags=re.IGNORECASE)
|
||||
t = re.sub(rf"<\s*{_DSML_PIPES}\s*DSML\s*{_DSML_PIPES}\s*invoke\s+name=", "<invoke name=", t, flags=re.IGNORECASE)
|
||||
t = re.sub(rf"<\s*/\s*{_DSML_PIPES}\s*DSML\s*{_DSML_PIPES}\s*invoke\s*>", "</invoke>", t, flags=re.IGNORECASE)
|
||||
# parameter open tag — drop any extra attrs (e.g. string="true").
|
||||
|
||||
Reference in New Issue
Block a user