Fix tool parsing: deduplicate tool calls, strip raw format from streaming content

- Add seen_signatures set to extract_tool_calls() to prevent duplicates
- Add strip_tool_calls_from_content() method to remove <tool>...</tool> tags
- Filter tool format from each chunk in real-time during streaming
- Simplify post-stream tool call handling since content is already cleaned
- Also handle non-streaming responses for tool call content cleanup
parent 821e40dd
This diff is collapsed.
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