@@ -1180,55 +1180,48 @@ async def test_data_collection_inputs(
11801180@pytest .mark .parametrize ("span_streaming" , [True , False ])
11811181@pytest .mark .parametrize ("stream_gen_ai_spans" , [True , False ])
11821182@pytest .mark .parametrize (
1183- "data_collection,send_default_pii,expect_output,expect_tool_calls " ,
1183+ "data_collection,send_default_pii,expect_output" ,
11841184 [
11851185 pytest .param (
11861186 {"gen_ai" : {"outputs" : True }},
11871187 False ,
11881188 True ,
1189- True ,
11901189 id = "gen-ai-outputs-enabled-overrides-pii-disabled" ,
11911190 ),
11921191 pytest .param (
11931192 {"gen_ai" : {"outputs" : False }},
11941193 True ,
11951194 False ,
1196- True ,
1197- id = "gen-ai-outputs-disabled-still-collects-tool-calls-gated-on-inputs" ,
1195+ id = "gen-ai-outputs-disabled-overrides-pii-enabled" ,
11981196 ),
11991197 pytest .param (
12001198 {},
12011199 False ,
12021200 True ,
1203- True ,
12041201 id = "gen-ai-omitted-defaults-to-enabled" ,
12051202 ),
12061203 pytest .param (
12071204 {"gen_ai" : {"inputs" : False , "outputs" : False }},
12081205 False ,
12091206 False ,
1210- False ,
12111207 id = "gen-ai-inputs-and-outputs-disabled-and-pii-disabled" ,
12121208 ),
12131209 pytest .param (
12141210 {"gen_ai" : {"inputs" : False }},
12151211 False ,
12161212 True ,
1217- False ,
1218- id = "gen-ai-inputs-disabled-drops-tool-calls-only" ,
1213+ id = "gen-ai-inputs-disabled-keeps-outputs-and-tool-calls" ,
12191214 ),
12201215 pytest .param (
12211216 None ,
12221217 False ,
12231218 False ,
1224- False ,
12251219 id = "no-data-collection-falls-back-to-send-default-pii" ,
12261220 ),
12271221 pytest .param (
12281222 None ,
12291223 True ,
12301224 True ,
1231- True ,
12321225 id = "no-data-collection-pii-enabled-collects" ,
12331226 ),
12341227 ],
@@ -1245,7 +1238,6 @@ async def test_data_collection_outputs(
12451238 data_collection ,
12461239 send_default_pii ,
12471240 expect_output ,
1248- expect_tool_calls ,
12491241 stream_gen_ai_spans ,
12501242 span_streaming ,
12511243):
@@ -1326,23 +1318,19 @@ async def test_data_collection_outputs(
13261318
13271319 assert len (chat_span_data ) == 2
13281320
1329- if expect_tool_calls :
1321+ if expect_output :
13301322 assert any (
13311323 "simple_test_tool" in data .get (SPANDATA .GEN_AI_RESPONSE_TOOL_CALLS , "" )
13321324 for data in chat_span_data
13331325 )
1334- else :
1335- for data in chat_span_data :
1336- assert SPANDATA .GEN_AI_RESPONSE_TOOL_CALLS not in data
1337-
1338- if expect_output :
13391326 assert any (
13401327 "Task completed using the tool"
13411328 in str (data .get (SPANDATA .GEN_AI_RESPONSE_TEXT , "" ))
13421329 for data in chat_span_data
13431330 )
13441331 else :
13451332 for data in chat_span_data :
1333+ assert SPANDATA .GEN_AI_RESPONSE_TOOL_CALLS not in data
13461334 assert SPANDATA .GEN_AI_RESPONSE_TEXT not in data
13471335
13481336 # Non-PII data is unaffected by the gate
0 commit comments