Commit Graph

1 Commits

Author SHA1 Message Date
bbarwik 7ed9be55b1 fix: merge annotations from all streaming chunks in stream_chunk_builder
Previously, stream_chunk_builder only took annotations from the first
chunk that contained them, losing any annotations from later chunks.

This is a problem because providers like Gemini/Vertex AI send grounding
metadata (converted to annotations) in the final streaming chunk, while
other providers may spread annotations across multiple chunks.

Changes:
- Collect and merge annotations from ALL annotation-bearing chunks
  instead of only using the first one
2026-03-15 14:20:45 +05:30