Skip to content

Commit 2010a6c

Browse files
committed
fix linter
1 parent dc0a147 commit 2010a6c

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

sentry_sdk/integrations/google_genai/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616

1717
try:
18-
from google import genai
1918
from google.genai.models import Models, AsyncModels
2019
except ImportError:
2120
raise DidNotEnable("google-genai not installed")

sentry_sdk/integrations/google_genai/streaming.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ class AccumulatedResponse(TypedDict):
3030
model: Optional[str]
3131
text: str
3232
finish_reasons: List[str]
33-
tool_calls: List[str]
33+
tool_calls: List[dict[str, Any]]
3434
usage_metadata: UsageData
3535

3636

3737
def accumulate_streaming_response(chunks):
38-
# type: (List[GenerateContentResponse]) -> dict[str, Any]
38+
# type: (List[GenerateContentResponse]) -> AccumulatedResponse
3939
"""Accumulate streaming chunks into a single response-like object."""
4040
accumulated_text = []
4141
finish_reasons = []

sentry_sdk/integrations/google_genai/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def extract_contents_text(contents):
171171

172172
# Content object with parts - recurse into parts
173173
if getattr(contents, "parts", None):
174-
return extract_contents_text(contents.parts) # type: ignore
174+
return extract_contents_text(contents.parts)
175175

176176
# Direct text attribute
177177
if hasattr(contents, "text"):
@@ -229,13 +229,13 @@ def extract_tool_calls(response):
229229

230230
# Extract from candidates, sometimes tool calls are nested under the content.parts object
231231
if getattr(response, "candidates", []):
232-
for candidate in response.candidates: # type: ignore
232+
for candidate in response.candidates:
233233
if not hasattr(candidate, "content") or not getattr(
234234
candidate.content, "parts", []
235235
):
236236
continue
237237

238-
for part in candidate.content.parts: # type: ignore
238+
for part in candidate.content.parts:
239239
if getattr(part, "function_call", None):
240240
function_call = part.function_call
241241
tool_call = {
@@ -245,7 +245,7 @@ def extract_tool_calls(response):
245245

246246
# Extract arguments if available
247247
if getattr(function_call, "args", None):
248-
tool_call["arguments"] = safe_serialize(function_call.args) # type: ignore
248+
tool_call["arguments"] = safe_serialize(function_call.args)
249249

250250
tool_calls.append(tool_call)
251251

0 commit comments

Comments
 (0)