Skip to content

Commit 43920b5

Browse files
promote to top level option
1 parent dcce855 commit 43920b5

9 files changed

Lines changed: 303 additions & 303 deletions

File tree

tests/integrations/anthropic/test_anthropic.py

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

tests/integrations/google_genai/test_google_genai.py

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def test_nonstreaming_generate_content(
137137
integrations=[GoogleGenAIIntegration(include_prompts=include_prompts)],
138138
traces_sample_rate=1.0,
139139
send_default_pii=send_default_pii,
140-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
140+
stream_gen_ai_spans=stream_gen_ai_spans,
141141
)
142142

143143
# Mock the HTTP response at the _api_client.request() level
@@ -281,7 +281,7 @@ def test_generate_content_with_system_instruction(
281281
integrations=[GoogleGenAIIntegration(include_prompts=True)],
282282
traces_sample_rate=1.0,
283283
send_default_pii=True,
284-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
284+
stream_gen_ai_spans=stream_gen_ai_spans,
285285
)
286286

287287
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -364,7 +364,7 @@ def test_generate_content_with_tools(
364364
sentry_init(
365365
integrations=[GoogleGenAIIntegration()],
366366
traces_sample_rate=1.0,
367-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
367+
stream_gen_ai_spans=stream_gen_ai_spans,
368368
)
369369

370370
# Create a mock tool function
@@ -482,7 +482,7 @@ def test_tool_execution(
482482
integrations=[GoogleGenAIIntegration(include_prompts=True)],
483483
traces_sample_rate=1.0,
484484
send_default_pii=True,
485-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
485+
stream_gen_ai_spans=stream_gen_ai_spans,
486486
)
487487

488488
# Create a mock tool function
@@ -548,7 +548,7 @@ def test_error_handling(
548548
sentry_init(
549549
integrations=[GoogleGenAIIntegration()],
550550
traces_sample_rate=1.0,
551-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
551+
stream_gen_ai_spans=stream_gen_ai_spans,
552552
)
553553
if stream_gen_ai_spans:
554554
items = capture_items("event", "transaction")
@@ -604,7 +604,7 @@ def test_streaming_generate_content(
604604
integrations=[GoogleGenAIIntegration(include_prompts=True)],
605605
traces_sample_rate=1.0,
606606
send_default_pii=True,
607-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
607+
stream_gen_ai_spans=stream_gen_ai_spans,
608608
)
609609

610610
# Create streaming chunks - simulating a multi-chunk response
@@ -797,7 +797,7 @@ def test_span_origin(
797797
sentry_init(
798798
integrations=[GoogleGenAIIntegration()],
799799
traces_sample_rate=1.0,
800-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
800+
stream_gen_ai_spans=stream_gen_ai_spans,
801801
)
802802

803803
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -849,7 +849,7 @@ def test_response_without_usage_metadata(
849849
sentry_init(
850850
integrations=[GoogleGenAIIntegration()],
851851
traces_sample_rate=1.0,
852-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
852+
stream_gen_ai_spans=stream_gen_ai_spans,
853853
)
854854

855855
# Response without usage metadata
@@ -917,7 +917,7 @@ def test_multiple_candidates(
917917
integrations=[GoogleGenAIIntegration(include_prompts=True)],
918918
traces_sample_rate=1.0,
919919
send_default_pii=True,
920-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
920+
stream_gen_ai_spans=stream_gen_ai_spans,
921921
)
922922

923923
# Response with multiple candidates
@@ -1021,7 +1021,7 @@ def test_all_configuration_parameters(
10211021
sentry_init(
10221022
integrations=[GoogleGenAIIntegration()],
10231023
traces_sample_rate=1.0,
1024-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1024+
stream_gen_ai_spans=stream_gen_ai_spans,
10251025
)
10261026

10271027
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -1103,7 +1103,7 @@ def test_empty_response(
11031103
sentry_init(
11041104
integrations=[GoogleGenAIIntegration()],
11051105
traces_sample_rate=1.0,
1106-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1106+
stream_gen_ai_spans=stream_gen_ai_spans,
11071107
)
11081108

11091109
# Minimal response with empty candidates array
@@ -1158,7 +1158,7 @@ def test_response_with_different_id_fields(
11581158
sentry_init(
11591159
integrations=[GoogleGenAIIntegration()],
11601160
traces_sample_rate=1.0,
1161-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1161+
stream_gen_ai_spans=stream_gen_ai_spans,
11621162
)
11631163

11641164
# Response with response_id and model_version
@@ -1248,7 +1248,7 @@ def test_contents_as_none(
12481248
integrations=[GoogleGenAIIntegration(include_prompts=True)],
12491249
traces_sample_rate=1.0,
12501250
send_default_pii=True,
1251-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1251+
stream_gen_ai_spans=stream_gen_ai_spans,
12521252
)
12531253

12541254
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -1299,7 +1299,7 @@ def test_tool_calls_extraction(
12991299
sentry_init(
13001300
integrations=[GoogleGenAIIntegration()],
13011301
traces_sample_rate=1.0,
1302-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1302+
stream_gen_ai_spans=stream_gen_ai_spans,
13031303
)
13041304

13051305
# Response with function calls
@@ -1414,7 +1414,7 @@ def test_google_genai_message_truncation(
14141414
integrations=[GoogleGenAIIntegration(include_prompts=True)],
14151415
traces_sample_rate=1.0,
14161416
send_default_pii=True,
1417-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1417+
stream_gen_ai_spans=stream_gen_ai_spans,
14181418
)
14191419

14201420
large_content = (
@@ -1515,7 +1515,7 @@ def test_embed_content(
15151515
integrations=[GoogleGenAIIntegration(include_prompts=include_prompts)],
15161516
traces_sample_rate=1.0,
15171517
send_default_pii=send_default_pii,
1518-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1518+
stream_gen_ai_spans=stream_gen_ai_spans,
15191519
)
15201520

15211521
# Mock the HTTP response at the _api_client.request() level
@@ -1637,7 +1637,7 @@ def test_embed_content_string_input(
16371637
integrations=[GoogleGenAIIntegration(include_prompts=True)],
16381638
traces_sample_rate=1.0,
16391639
send_default_pii=True,
1640-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1640+
stream_gen_ai_spans=stream_gen_ai_spans,
16411641
)
16421642

16431643
# Mock response with single embedding
@@ -1717,7 +1717,7 @@ def test_embed_content_error_handling(
17171717
sentry_init(
17181718
integrations=[GoogleGenAIIntegration()],
17191719
traces_sample_rate=1.0,
1720-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1720+
stream_gen_ai_spans=stream_gen_ai_spans,
17211721
)
17221722
if stream_gen_ai_spans:
17231723
items = capture_items("transaction", "event")
@@ -1774,7 +1774,7 @@ def test_embed_content_without_statistics(
17741774
sentry_init(
17751775
integrations=[GoogleGenAIIntegration()],
17761776
traces_sample_rate=1.0,
1777-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1777+
stream_gen_ai_spans=stream_gen_ai_spans,
17781778
)
17791779

17801780
# Response without statistics (typical for older google-genai versions)
@@ -1839,7 +1839,7 @@ def test_embed_content_span_origin(
18391839
sentry_init(
18401840
integrations=[GoogleGenAIIntegration()],
18411841
traces_sample_rate=1.0,
1842-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1842+
stream_gen_ai_spans=stream_gen_ai_spans,
18431843
)
18441844

18451845
mock_http_response = create_mock_http_response(EXAMPLE_EMBED_RESPONSE_JSON)
@@ -1901,7 +1901,7 @@ async def test_async_embed_content(
19011901
integrations=[GoogleGenAIIntegration(include_prompts=include_prompts)],
19021902
traces_sample_rate=1.0,
19031903
send_default_pii=send_default_pii,
1904-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1904+
stream_gen_ai_spans=stream_gen_ai_spans,
19051905
)
19061906

19071907
# Mock the async HTTP response
@@ -2024,7 +2024,7 @@ async def test_async_embed_content_string_input(
20242024
integrations=[GoogleGenAIIntegration(include_prompts=True)],
20252025
traces_sample_rate=1.0,
20262026
send_default_pii=True,
2027-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2027+
stream_gen_ai_spans=stream_gen_ai_spans,
20282028
)
20292029

20302030
# Mock response with single embedding
@@ -2109,7 +2109,7 @@ async def test_async_embed_content_error_handling(
21092109
sentry_init(
21102110
integrations=[GoogleGenAIIntegration()],
21112111
traces_sample_rate=1.0,
2112-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2112+
stream_gen_ai_spans=stream_gen_ai_spans,
21132113
)
21142114

21152115
if stream_gen_ai_spans:
@@ -2168,7 +2168,7 @@ async def test_async_embed_content_without_statistics(
21682168
sentry_init(
21692169
integrations=[GoogleGenAIIntegration()],
21702170
traces_sample_rate=1.0,
2171-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2171+
stream_gen_ai_spans=stream_gen_ai_spans,
21722172
)
21732173

21742174
# Response without statistics (typical for older google-genai versions)
@@ -2238,7 +2238,7 @@ async def test_async_embed_content_span_origin(
22382238
sentry_init(
22392239
integrations=[GoogleGenAIIntegration()],
22402240
traces_sample_rate=1.0,
2241-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2241+
stream_gen_ai_spans=stream_gen_ai_spans,
22422242
)
22432243

22442244
mock_http_response = create_mock_http_response(EXAMPLE_EMBED_RESPONSE_JSON)
@@ -2296,7 +2296,7 @@ def test_generate_content_with_content_object(
22962296
integrations=[GoogleGenAIIntegration(include_prompts=True)],
22972297
traces_sample_rate=1.0,
22982298
send_default_pii=True,
2299-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2299+
stream_gen_ai_spans=stream_gen_ai_spans,
23002300
)
23012301

23022302
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -2356,7 +2356,7 @@ def test_generate_content_with_dict_format(
23562356
integrations=[GoogleGenAIIntegration(include_prompts=True)],
23572357
traces_sample_rate=1.0,
23582358
send_default_pii=True,
2359-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2359+
stream_gen_ai_spans=stream_gen_ai_spans,
23602360
)
23612361

23622362
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -2414,7 +2414,7 @@ def test_generate_content_with_file_data(
24142414
integrations=[GoogleGenAIIntegration(include_prompts=True)],
24152415
traces_sample_rate=1.0,
24162416
send_default_pii=True,
2417-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2417+
stream_gen_ai_spans=stream_gen_ai_spans,
24182418
)
24192419

24202420
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -2487,7 +2487,7 @@ def test_generate_content_with_inline_data(
24872487
integrations=[GoogleGenAIIntegration(include_prompts=True)],
24882488
traces_sample_rate=1.0,
24892489
send_default_pii=True,
2490-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2490+
stream_gen_ai_spans=stream_gen_ai_spans,
24912491
)
24922492

24932493
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -2556,7 +2556,7 @@ def test_generate_content_with_function_response(
25562556
integrations=[GoogleGenAIIntegration(include_prompts=True)],
25572557
traces_sample_rate=1.0,
25582558
send_default_pii=True,
2559-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2559+
stream_gen_ai_spans=stream_gen_ai_spans,
25602560
)
25612561

25622562
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -2634,7 +2634,7 @@ def test_generate_content_with_mixed_string_and_content(
26342634
integrations=[GoogleGenAIIntegration(include_prompts=True)],
26352635
traces_sample_rate=1.0,
26362636
send_default_pii=True,
2637-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2637+
stream_gen_ai_spans=stream_gen_ai_spans,
26382638
)
26392639

26402640
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -2701,7 +2701,7 @@ def test_generate_content_with_part_object_directly(
27012701
integrations=[GoogleGenAIIntegration(include_prompts=True)],
27022702
traces_sample_rate=1.0,
27032703
send_default_pii=True,
2704-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2704+
stream_gen_ai_spans=stream_gen_ai_spans,
27052705
)
27062706

27072707
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -2763,7 +2763,7 @@ def test_generate_content_with_list_of_dicts(
27632763
integrations=[GoogleGenAIIntegration(include_prompts=True)],
27642764
traces_sample_rate=1.0,
27652765
send_default_pii=True,
2766-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2766+
stream_gen_ai_spans=stream_gen_ai_spans,
27672767
)
27682768

27692769
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -2823,7 +2823,7 @@ def test_generate_content_with_dict_inline_data(
28232823
integrations=[GoogleGenAIIntegration(include_prompts=True)],
28242824
traces_sample_rate=1.0,
28252825
send_default_pii=True,
2826-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2826+
stream_gen_ai_spans=stream_gen_ai_spans,
28272827
)
28282828

28292829
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -2891,7 +2891,7 @@ def test_generate_content_without_parts_property_inline_data(
28912891
integrations=[GoogleGenAIIntegration(include_prompts=True)],
28922892
traces_sample_rate=1.0,
28932893
send_default_pii=True,
2894-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2894+
stream_gen_ai_spans=stream_gen_ai_spans,
28952895
)
28962896

28972897
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)
@@ -2957,7 +2957,7 @@ def test_generate_content_without_parts_property_inline_data_and_binary_data_wit
29572957
integrations=[GoogleGenAIIntegration(include_prompts=True)],
29582958
traces_sample_rate=1.0,
29592959
send_default_pii=True,
2960-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
2960+
stream_gen_ai_spans=stream_gen_ai_spans,
29612961
)
29622962

29632963
mock_http_response = create_mock_http_response(EXAMPLE_API_RESPONSE_JSON)

tests/integrations/huggingface_hub/test_huggingface_hub.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def test_text_generation(
483483
traces_sample_rate=1.0,
484484
send_default_pii=send_default_pii,
485485
integrations=[HuggingfaceHubIntegration(include_prompts=include_prompts)],
486-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
486+
stream_gen_ai_spans=stream_gen_ai_spans,
487487
)
488488

489489
client = InferenceClient(model="test-model")
@@ -618,7 +618,7 @@ def test_text_generation_streaming(
618618
traces_sample_rate=1.0,
619619
send_default_pii=send_default_pii,
620620
integrations=[HuggingfaceHubIntegration(include_prompts=include_prompts)],
621-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
621+
stream_gen_ai_spans=stream_gen_ai_spans,
622622
)
623623

624624
client = InferenceClient(model="test-model")
@@ -751,7 +751,7 @@ def test_chat_completion(
751751
traces_sample_rate=1.0,
752752
send_default_pii=send_default_pii,
753753
integrations=[HuggingfaceHubIntegration(include_prompts=include_prompts)],
754-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
754+
stream_gen_ai_spans=stream_gen_ai_spans,
755755
)
756756

757757
client = get_hf_provider_inference_client()
@@ -888,7 +888,7 @@ def test_chat_completion_streaming(
888888
traces_sample_rate=1.0,
889889
send_default_pii=send_default_pii,
890890
integrations=[HuggingfaceHubIntegration(include_prompts=include_prompts)],
891-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
891+
stream_gen_ai_spans=stream_gen_ai_spans,
892892
)
893893

894894
client = get_hf_provider_inference_client()
@@ -1024,7 +1024,7 @@ def test_chat_completion_api_error(
10241024
):
10251025
sentry_init(
10261026
traces_sample_rate=1.0,
1027-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1027+
stream_gen_ai_spans=stream_gen_ai_spans,
10281028
)
10291029

10301030
client = get_hf_provider_inference_client()
@@ -1140,7 +1140,7 @@ def test_span_status_error(
11401140

11411141
sentry_init(
11421142
traces_sample_rate=1.0,
1143-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1143+
stream_gen_ai_spans=stream_gen_ai_spans,
11441144
)
11451145

11461146
if stream_gen_ai_spans:
@@ -1210,7 +1210,7 @@ def test_chat_completion_with_tools(
12101210
traces_sample_rate=1.0,
12111211
send_default_pii=send_default_pii,
12121212
integrations=[HuggingfaceHubIntegration(include_prompts=include_prompts)],
1213-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1213+
stream_gen_ai_spans=stream_gen_ai_spans,
12141214
)
12151215

12161216
client = get_hf_provider_inference_client()
@@ -1366,7 +1366,7 @@ def test_chat_completion_streaming_with_tools(
13661366
traces_sample_rate=1.0,
13671367
send_default_pii=send_default_pii,
13681368
integrations=[HuggingfaceHubIntegration(include_prompts=include_prompts)],
1369-
_experiments={"stream_gen_ai_spans": stream_gen_ai_spans},
1369+
stream_gen_ai_spans=stream_gen_ai_spans,
13701370
)
13711371

13721372
client = get_hf_provider_inference_client()

0 commit comments

Comments
 (0)