From c9535e0a720ec3b2fe4ff0cc3dc5fd604a780a36 Mon Sep 17 00:00:00 2001 From: Hemang Date: Wed, 12 Mar 2025 21:56:19 +0100 Subject: [PATCH] Fix test_chat_completion_with_tool_call_without_streaming. --- tests/open_ai/test_chat_with_tool_call.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/open_ai/test_chat_with_tool_call.py b/tests/open_ai/test_chat_with_tool_call.py index 93eba77..ed5ffee 100644 --- a/tests/open_ai/test_chat_with_tool_call.py +++ b/tests/open_ai/test_chat_with_tool_call.py @@ -62,12 +62,12 @@ async def test_chat_completion_with_tool_call_without_streaming( assert chat_response.choices[0].message.role == "assistant" # Extract tool call assert len(chat_response.choices[0].message.tool_calls) == 1 - assert chat_response.choices[0].message.tool_calls[0].function.name == "get_weather" - assert ( - chat_response.choices[0].message.tool_calls[0].function.arguments - == '{"location":"New York"}' - ) tool_call = chat_response.choices[0].message.tool_calls[0] + assert tool_call.function.name == "get_weather" + assert ( + "New York" in tool_call.function.arguments + and "location" in tool_call.function.arguments + ) # Mock response of tool call tool_result = "The temperature in New York is 15°C and it is raining."