Skip to content

Commit 3d165f3

Browse files
committed
feedback
1 parent 1492349 commit 3d165f3

File tree

7 files changed

+47
-35
lines changed

7 files changed

+47
-35
lines changed

scripts/populate_tox/releases.jsonl

Lines changed: 7 additions & 4 deletions
Large diffs are not rendered by default.

sentry_sdk/integrations/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def iter_default_integrations(with_auto_enabling_integrations):
9191
"sentry_sdk.integrations.flask.FlaskIntegration",
9292
"sentry_sdk.integrations.gql.GQLIntegration",
9393
"sentry_sdk.integrations.graphene.GrapheneIntegration",
94-
"sentry_sdk.integrations.google_genai.GoogleGenAIIntegration",
9594
"sentry_sdk.integrations.httpx.HttpxIntegration",
9695
"sentry_sdk.integrations.huey.HueyIntegration",
9796
"sentry_sdk.integrations.huggingface_hub.HuggingfaceHubIntegration",

sentry_sdk/integrations/google_genai/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
set_span_data_for_request,
2525
set_span_data_for_response,
2626
capture_exception,
27+
prepare_generate_content_args,
2728
)
2829
from .streaming import (
2930
set_span_data_for_streaming_response,
3031
accumulate_streaming_response,
31-
prepare_generate_content_args,
3232
)
3333

3434

sentry_sdk/integrations/google_genai/streaming.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,6 @@
2424
from google.genai.types import GenerateContentResponse
2525

2626

27-
def prepare_generate_content_args(args, kwargs):
28-
# type: (tuple[Any, ...], dict[str, Any]) -> tuple[Any, Any, str]
29-
"""Extract and prepare common arguments for generate_content methods."""
30-
model = args[0] if args else kwargs.get("model", "unknown")
31-
contents = args[1] if len(args) > 1 else kwargs.get("contents")
32-
model_name = get_model_name(model)
33-
34-
# Wrap config with tools
35-
config = kwargs.get("config")
36-
wrapped_config = wrapped_config_with_tools(config)
37-
if wrapped_config is not config:
38-
kwargs["config"] = wrapped_config
39-
40-
return model, contents, model_name
41-
42-
4327
def accumulate_streaming_response(chunks):
4428
# type: (List[GenerateContentResponse]) -> dict[str, Any]
4529
"""Accumulate streaming chunks into a single response-like object."""

sentry_sdk/integrations/google_genai/utils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,3 +561,19 @@ def set_span_data_for_response(span, integration, response):
561561
# Set total token count if available
562562
if usage_data["total_tokens"]:
563563
span.set_data(SPANDATA.GEN_AI_USAGE_TOTAL_TOKENS, usage_data["total_tokens"])
564+
565+
566+
def prepare_generate_content_args(args, kwargs):
567+
# type: (tuple[Any, ...], dict[str, Any]) -> tuple[Any, Any, str]
568+
"""Extract and prepare common arguments for generate_content methods."""
569+
model = args[0] if args else kwargs.get("model", "unknown")
570+
contents = args[1] if len(args) > 1 else kwargs.get("contents")
571+
model_name = get_model_name(model)
572+
573+
# Wrap config with tools
574+
config = kwargs.get("config")
575+
wrapped_config = wrapped_config_with_tools(config)
576+
if wrapped_config is not config:
577+
kwargs["config"] = wrapped_config
578+
579+
return model, contents, model_name

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def get_file_text(file_name):
8484
"statsig": ["statsig>=0.55.3"],
8585
"tornado": ["tornado>=6"],
8686
"unleash": ["UnleashClient>=6.0.1"],
87-
"google-genai": ["google-genai"],
87+
"google-genai": ["google-genai>=1.0.0"],
8888
},
8989
entry_points={
9090
"opentelemetry_propagator": [

tox.ini

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ envlist =
7878
{py3.9,py3.12,py3.13}-langgraph-v0.6.8
7979
{py3.10,py3.12,py3.13}-langgraph-v1.0.0a4
8080

81+
{py3.9,py3.11,py3.12}-google-genai-v0.0.1
82+
{py3.9,py3.12,py3.13}-google-genai-v0.8.0
83+
{py3.9,py3.12,py3.13}-google-genai-v1.41.0
84+
8185
{py3.10,py3.11,py3.12}-openai_agents-v0.0.19
8286
{py3.10,py3.12,py3.13}-openai_agents-v0.1.0
8387
{py3.10,py3.12,py3.13}-openai_agents-v0.2.11
@@ -87,14 +91,14 @@ envlist =
8791
{py3.8,py3.12,py3.13}-huggingface_hub-v0.28.1
8892
{py3.8,py3.12,py3.13}-huggingface_hub-v0.32.6
8993
{py3.8,py3.12,py3.13}-huggingface_hub-v0.35.3
90-
{py3.9,py3.12,py3.13}-huggingface_hub-v1.0.0rc2
94+
{py3.9,py3.12,py3.13}-huggingface_hub-v1.0.0rc4
9195

9296

9397
# ~~~ Cloud ~~~
9498
{py3.6,py3.7}-boto3-v1.12.49
9599
{py3.6,py3.9,py3.10}-boto3-v1.20.54
96100
{py3.7,py3.11,py3.12}-boto3-v1.28.85
97-
{py3.9,py3.12,py3.13}-boto3-v1.40.46
101+
{py3.9,py3.12,py3.13}-boto3-v1.40.47
98102

99103
{py3.6,py3.7,py3.8}-chalice-v1.16.0
100104
{py3.9,py3.12,py3.13}-chalice-v1.32.0
@@ -110,14 +114,14 @@ envlist =
110114

111115
{py3.6}-pymongo-v3.5.1
112116
{py3.6,py3.10,py3.11}-pymongo-v3.13.0
113-
{py3.9,py3.12,py3.13}-pymongo-v4.15.2
117+
{py3.9,py3.12,py3.13}-pymongo-v4.15.3
114118

115119
{py3.6}-redis-v2.10.6
116120
{py3.6,py3.7,py3.8}-redis-v3.5.3
117121
{py3.7,py3.10,py3.11}-redis-v4.6.0
118122
{py3.8,py3.11,py3.12}-redis-v5.3.1
119123
{py3.9,py3.12,py3.13}-redis-v6.4.0
120-
{py3.9,py3.12,py3.13}-redis-v7.0.0b2
124+
{py3.9,py3.12,py3.13}-redis-v7.0.0b3
121125

122126
{py3.6}-redis_py_cluster_legacy-v1.3.6
123127
{py3.6,py3.7,py3.8}-redis_py_cluster_legacy-v2.1.3
@@ -153,7 +157,7 @@ envlist =
153157
{py3.8,py3.12,py3.13}-graphene-v3.4.3
154158

155159
{py3.8,py3.10,py3.11}-strawberry-v0.209.8
156-
{py3.9,py3.12,py3.13}-strawberry-v0.283.1
160+
{py3.9,py3.12,py3.13}-strawberry-v0.283.2
157161

158162

159163
# ~~~ Network ~~~
@@ -222,7 +226,7 @@ envlist =
222226
{py3.6,py3.9,py3.10}-fastapi-v0.79.1
223227
{py3.7,py3.10,py3.11}-fastapi-v0.92.0
224228
{py3.8,py3.10,py3.11}-fastapi-v0.105.0
225-
{py3.8,py3.12,py3.13}-fastapi-v0.118.0
229+
{py3.8,py3.12,py3.13}-fastapi-v0.118.1
226230

227231

228232
# ~~~ Web 2 ~~~
@@ -381,6 +385,11 @@ deps =
381385
langgraph-v0.6.8: langgraph==0.6.8
382386
langgraph-v1.0.0a4: langgraph==1.0.0a4
383387

388+
google-genai-v0.0.1: google-genai==0.0.1
389+
google-genai-v0.8.0: google-genai==0.8.0
390+
google-genai-v1.41.0: google-genai==1.41.0
391+
google-genai: pytest-asyncio
392+
384393
openai_agents-v0.0.19: openai-agents==0.0.19
385394
openai_agents-v0.1.0: openai-agents==0.1.0
386395
openai_agents-v0.2.11: openai-agents==0.2.11
@@ -391,7 +400,7 @@ deps =
391400
huggingface_hub-v0.28.1: huggingface_hub==0.28.1
392401
huggingface_hub-v0.32.6: huggingface_hub==0.32.6
393402
huggingface_hub-v0.35.3: huggingface_hub==0.35.3
394-
huggingface_hub-v1.0.0rc2: huggingface_hub==1.0.0rc2
403+
huggingface_hub-v1.0.0rc4: huggingface_hub==1.0.0rc4
395404
huggingface_hub: responses
396405
huggingface_hub: pytest-httpx
397406

@@ -400,7 +409,7 @@ deps =
400409
boto3-v1.12.49: boto3==1.12.49
401410
boto3-v1.20.54: boto3==1.20.54
402411
boto3-v1.28.85: boto3==1.28.85
403-
boto3-v1.40.46: boto3==1.40.46
412+
boto3-v1.40.47: boto3==1.40.47
404413
{py3.7,py3.8}-boto3: urllib3<2.0.0
405414

406415
chalice-v1.16.0: chalice==1.16.0
@@ -419,15 +428,15 @@ deps =
419428

420429
pymongo-v3.5.1: pymongo==3.5.1
421430
pymongo-v3.13.0: pymongo==3.13.0
422-
pymongo-v4.15.2: pymongo==4.15.2
431+
pymongo-v4.15.3: pymongo==4.15.3
423432
pymongo: mockupdb
424433

425434
redis-v2.10.6: redis==2.10.6
426435
redis-v3.5.3: redis==3.5.3
427436
redis-v4.6.0: redis==4.6.0
428437
redis-v5.3.1: redis==5.3.1
429438
redis-v6.4.0: redis==6.4.0
430-
redis-v7.0.0b2: redis==7.0.0b2
439+
redis-v7.0.0b3: redis==7.0.0b3
431440
redis: fakeredis!=1.7.4
432441
redis: pytest<8.0.0
433442
redis-v4.6.0: fakeredis<2.31.0
@@ -477,7 +486,7 @@ deps =
477486
{py3.6}-graphene: aiocontextvars
478487

479488
strawberry-v0.209.8: strawberry-graphql[fastapi,flask]==0.209.8
480-
strawberry-v0.283.1: strawberry-graphql[fastapi,flask]==0.283.1
489+
strawberry-v0.283.2: strawberry-graphql[fastapi,flask]==0.283.2
481490
strawberry: httpx
482491
strawberry-v0.209.8: pydantic<2.11
483492

@@ -604,7 +613,7 @@ deps =
604613
fastapi-v0.79.1: fastapi==0.79.1
605614
fastapi-v0.92.0: fastapi==0.92.0
606615
fastapi-v0.105.0: fastapi==0.105.0
607-
fastapi-v0.118.0: fastapi==0.118.0
616+
fastapi-v0.118.1: fastapi==0.118.1
608617
fastapi: httpx
609618
fastapi: pytest-asyncio
610619
fastapi: python-multipart
@@ -747,6 +756,7 @@ setenv =
747756
falcon: TESTPATH=tests/integrations/falcon
748757
fastapi: TESTPATH=tests/integrations/fastapi
749758
flask: TESTPATH=tests/integrations/flask
759+
google-genai: TESTPATH=tests/integrations/google-genai
750760
gql: TESTPATH=tests/integrations/gql
751761
graphene: TESTPATH=tests/integrations/graphene
752762
grpc: TESTPATH=tests/integrations/grpc

0 commit comments

Comments
 (0)