Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Make the tool name optional when parsing llm output

Tomas Valentae66d8ac33a6d
diff --git a/api-service/codegen/agent/parsing.py b/api-service/codegen/agent/parsing.py
index 8cc9da457..46eff0a9e 100644
--- a/api-service/codegen/agent/parsing.py
+++ b/api-service/codegen/agent/parsing.py
@@ -35,7 +35,7 @@ def merge_logs(log: TypedDict, other: TypedDict):
log.update(other)
-action_tag_open = "<action(?:\\s+tool=\".+?\")\\s*/?>?"
+action_tag_open = "<action(?:\\s+tool=\".+?\")?\\s*/?>?"
action_tag_close = "</\\s*action\\s*>?"
action_tag_split_pattern = re.compile(f"({action_tag_open})|({action_tag_close})|(.+?)")