Skip to content
Open
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
11 changes: 7 additions & 4 deletions sentry_sdk/integrations/google_genai/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,13 @@ def set_span_data_for_streaming_response(
safe_serialize(accumulated_response["tool_calls"]),
)

if accumulated_response.get("id"):
span.set_data(SPANDATA.GEN_AI_RESPONSE_ID, accumulated_response["id"])
if accumulated_response.get("model"):
span.set_data(SPANDATA.GEN_AI_RESPONSE_MODEL, accumulated_response["model"])
response_id = accumulated_response.get("id")
if response_id is not None:
span.set_data(SPANDATA.GEN_AI_RESPONSE_ID, response_id)

response_model = accumulated_response.get("model")
if response_model is not None:
span.set_data(SPANDATA.GEN_AI_RESPONSE_MODEL, response_model)

if accumulated_response["usage_metadata"] is None:
return
Expand Down
Loading