File tree Expand file tree Collapse file tree
sentry_sdk/integrations/google_genai Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,10 +123,13 @@ def set_span_data_for_streaming_response(
123123 safe_serialize (accumulated_response ["tool_calls" ]),
124124 )
125125
126- if accumulated_response .get ("id" ):
127- span .set_data (SPANDATA .GEN_AI_RESPONSE_ID , accumulated_response ["id" ])
128- if accumulated_response .get ("model" ):
129- span .set_data (SPANDATA .GEN_AI_RESPONSE_MODEL , accumulated_response ["model" ])
126+ response_id = accumulated_response .get ("id" )
127+ if response_id is not None :
128+ span .set_data (SPANDATA .GEN_AI_RESPONSE_ID , response_id )
129+
130+ response_model = accumulated_response .get ("model" )
131+ if response_model is not None :
132+ span .set_data (SPANDATA .GEN_AI_RESPONSE_MODEL , response_model )
130133
131134 if accumulated_response ["usage_metadata" ] is None :
132135 return
You can’t perform that action at this time.
0 commit comments