@@ -225,22 +225,33 @@ def raise_client_error(**kwargs):
225225 assert span ["status" ] == "internal_error"
226226
227227
228+ @pytest .mark .parametrize ("data_collection" , [True , False ])
228229@pytest .mark .parametrize ("span_streaming" , [True , False ])
229230@pytest .mark .parametrize ("stream_gen_ai_spans" , [True , False ])
230231def test_converse_tool_definitions (
231232 sentry_init ,
232233 capture_items ,
233234 capture_events ,
235+ data_collection ,
234236 span_streaming ,
235237 stream_gen_ai_spans ,
236238 converse_response ,
237239):
238- sentry_init (
239- traces_sample_rate = 1.0 ,
240- integrations = [Boto3Integration ()],
241- stream_gen_ai_spans = stream_gen_ai_spans ,
242- trace_lifecycle = "stream" if span_streaming else "static" ,
243- )
240+ if data_collection :
241+ sentry_init (
242+ traces_sample_rate = 1.0 ,
243+ integrations = [Boto3Integration ()],
244+ data_collection = {"gen_ai" : {"inputs" : True }},
245+ stream_gen_ai_spans = stream_gen_ai_spans ,
246+ trace_lifecycle = "stream" if span_streaming else "static" ,
247+ )
248+ else :
249+ sentry_init (
250+ traces_sample_rate = 1.0 ,
251+ integrations = [Boto3Integration ()],
252+ stream_gen_ai_spans = stream_gen_ai_spans ,
253+ trace_lifecycle = "stream" if span_streaming else "static" ,
254+ )
244255
245256 tools : list = [
246257 {
@@ -514,21 +525,32 @@ def raise_client_error(**kwargs):
514525 assert span ["status" ] == "internal_error"
515526
516527
528+ @pytest .mark .parametrize ("data_collection" , [True , False ])
517529@pytest .mark .parametrize ("span_streaming" , [True , False ])
518530@pytest .mark .parametrize ("stream_gen_ai_spans" , [True , False ])
519531def test_converse_stream_tool_definitions (
520532 sentry_init ,
521533 capture_items ,
522534 capture_events ,
535+ data_collection ,
523536 span_streaming ,
524537 stream_gen_ai_spans ,
525538):
526- sentry_init (
527- traces_sample_rate = 1.0 ,
528- integrations = [Boto3Integration ()],
529- stream_gen_ai_spans = stream_gen_ai_spans ,
530- trace_lifecycle = "stream" if span_streaming else "static" ,
531- )
539+ if data_collection :
540+ sentry_init (
541+ traces_sample_rate = 1.0 ,
542+ integrations = [Boto3Integration ()],
543+ data_collection = {"gen_ai" : {"inputs" : True }},
544+ stream_gen_ai_spans = stream_gen_ai_spans ,
545+ trace_lifecycle = "stream" if span_streaming else "static" ,
546+ )
547+ else :
548+ sentry_init (
549+ traces_sample_rate = 1.0 ,
550+ integrations = [Boto3Integration ()],
551+ stream_gen_ai_spans = stream_gen_ai_spans ,
552+ trace_lifecycle = "stream" if span_streaming else "static" ,
553+ )
532554
533555 tools : list = [
534556 {
0 commit comments