File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed
tests/integrations/openai_agents Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -1382,18 +1382,22 @@ def simple_test_tool(message: str) -> str:
13821382 assert ai_client_span1 ["data" ]["gen_ai.usage.output_tokens" ] == 5
13831383 assert ai_client_span1 ["data" ]["gen_ai.usage.output_tokens.reasoning" ] == 0
13841384 assert ai_client_span1 ["data" ]["gen_ai.usage.total_tokens" ] == 15
1385- assert ai_client_span1 ["data" ]["gen_ai.response.tool_calls" ] == safe_serialize (
1386- [
1387- {
1388- "arguments" : '{"message": "hello"}' ,
1389- "call_id" : "call_123" ,
1390- "name" : "simple_test_tool" ,
1391- "type" : "function_call" ,
1392- "id" : "call_123" ,
1393- "status" : None ,
1394- }
1395- ]
1396- )
1385+
1386+ tool_call = {
1387+ "arguments" : '{"message": "hello"}' ,
1388+ "call_id" : "call_123" ,
1389+ "name" : "simple_test_tool" ,
1390+ "type" : "function_call" ,
1391+ "id" : "call_123" ,
1392+ "status" : None ,
1393+ }
1394+
1395+ if OPENAI_VERSION >= (2 , 25 , 0 ):
1396+ tool_call ["namespace" ] = None
1397+
1398+ assert json .loads (ai_client_span1 ["data" ]["gen_ai.response.tool_calls" ]) == [
1399+ tool_call
1400+ ]
13971401
13981402 assert tool_span ["description" ] == "execute_tool simple_test_tool"
13991403 assert tool_span ["data" ]["gen_ai.agent.name" ] == "test_agent"
You can’t perform that action at this time.
0 commit comments