Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Tweak action tag parse regex

Tomas Valentaab1392fc5d7a
diff --git a/api-service/codegen/agent/base.py b/api-service/codegen/agent/base.py
index 9a2b36972..7c551021f 100644
--- a/api-service/codegen/agent/base.py
+++ b/api-service/codegen/agent/base.py
@@ -45,7 +45,7 @@ def merge_dict(t: TypedDict, o: TypedDict):
t.update(o)
action_tag_open = "<action(\\s+tool=\".+?\")?\\s*\\/?>?"
-action_tag_close = "</\\s*action>?"
+action_tag_close = "</\\s*action\\s*>?"
action_tag_check_pattern = re.compile(f"{action_tag_open}|{action_tag_close}")
action_tag_split_pattern = re.compile(f"({action_tag_open}.*?{action_tag_close})|(.+)")