File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
sentry_sdk/integrations/google_genai Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ def accumulate_streaming_response(chunks):
95
95
96
96
97
97
def set_span_data_for_streaming_response (span , integration , accumulated_response ):
98
- # type: (Span, Any, dict[str, Any] ) -> None
98
+ # type: (Span, Any, AccumulatedResponse ) -> None
99
99
"""Set span data for accumulated streaming response."""
100
100
# Set response text
101
101
if (
Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ def extract_tool_calls(response):
256
256
if not getattr (content , "parts" , None ):
257
257
continue
258
258
259
- for part in content . parts :
259
+ for part in getattr ( content , " parts" , []) :
260
260
if getattr (part , "function_call" , None ):
261
261
function_call = part .function_call
262
262
tool_call = {
@@ -416,7 +416,7 @@ def extract_finish_reasons(response):
416
416
return None
417
417
418
418
finish_reasons = []
419
- for candidate in response . candidates :
419
+ for candidate in getattr ( response , " candidates" , []) :
420
420
if getattr (candidate , "finish_reason" , None ):
421
421
# Convert enum value to string if necessary
422
422
reason = str (candidate .finish_reason )
You can’t perform that action at this time.
0 commit comments