fix: Stream chunks normally, only add tool call chunk at end

Instead of collecting all chunks and sending a modified response:
- Stream chunks normally as they come (with deltas like before)
- Only at the END, if tool call pattern detected, send additional chunk with tool_calls
- Then send final chunk with usage statistics

This preserves the original streaming behavior while adding tool call detection.
parent 72c50449
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