Fix tool_call regex to handle multiline JSON

parent 30f3e8a0
......@@ -508,7 +508,7 @@ class CoderClient:
parsed = []
# Format 1: <tool_call>{"name": "...", "arguments": {...}}</tool_call>
pattern1 = r'<tool_call>\s*(\{[^}]+\})\s*</tool_call>'
pattern1 = r'<tool_call>\s*(\{.*?\})\s*</tool_call>'
matches1 = re.findall(pattern1, text, re.DOTALL)
for match in matches1:
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment