Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions sentry_sdk/integrations/google_genai/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ def accumulate_streaming_response(
if extracted_tool_calls:
tool_calls.extend(extracted_tool_calls)

# Capture response_id and model_version from the first chunk that
# contains them (subsequent chunks typically carry the same values).
if not response_id:
response_id = getattr(chunk, "response_id", None) or None
if not model:
model = getattr(chunk, "model_version", None) or None

# Use last possible chunk, in case of interruption, and
# gracefully handle missing intermediate tokens by taking maximum
# with previous token reporting.
Expand Down
Loading