Skip to content

Commit bc2a62f

Browse files
committed
more fixes
1 parent 2010a6c commit bc2a62f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sentry_sdk/integrations/google_genai/streaming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def accumulate_streaming_response(chunks):
9595

9696

9797
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
9999
"""Set span data for accumulated streaming response."""
100100
# Set response text
101101
if (

sentry_sdk/integrations/google_genai/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def extract_tool_calls(response):
256256
if not getattr(content, "parts", None):
257257
continue
258258

259-
for part in content.parts:
259+
for part in getattr(content, "parts", []):
260260
if getattr(part, "function_call", None):
261261
function_call = part.function_call
262262
tool_call = {
@@ -416,7 +416,7 @@ def extract_finish_reasons(response):
416416
return None
417417

418418
finish_reasons = []
419-
for candidate in response.candidates:
419+
for candidate in getattr(response, "candidates", []):
420420
if getattr(candidate, "finish_reason", None):
421421
# Convert enum value to string if necessary
422422
reason = str(candidate.finish_reason)

0 commit comments

Comments
 (0)