Skip to content

Commit a6c52d6

Browse files
.
1 parent 769440f commit a6c52d6

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

tests/integrations/openai_agents/test_openai_agents.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)