fix: remove stray brace in tool_pattern regex

This commit is contained in:
Liang Jiaqing
2026-04-01 09:47:53 +08:00
parent 1c38412e42
commit 368d68baa5

View File

@@ -748,7 +748,7 @@ class ToolClient:
remaining_text = re.sub(think_pattern, "", remaining_text, flags=re.DOTALL) remaining_text = re.sub(think_pattern, "", remaining_text, flags=re.DOTALL)
tool_calls = []; json_strs = []; errors = [] tool_calls = []; json_strs = []; errors = []
tool_pattern = r"<(?:tool_use|tool_call)>((?:(?!<(?:tool_use|tool_call)>).){15,}?)</(?:tool_use|tool_call)>"} tool_pattern = r"<(?:tool_use|tool_call)>((?:(?!<(?:tool_use|tool_call)>).){15,}?)</(?:tool_use|tool_call)>"
tool_all = re.findall(tool_pattern, remaining_text, re.DOTALL) tool_all = re.findall(tool_pattern, remaining_text, re.DOTALL)
if tool_all: if tool_all: