@@ -339,7 +339,7 @@ def test_live_run_with_tools(self, tools):
339339 tool_call = message .tool_call
340340 assert isinstance (tool_call , ToolCall )
341341 assert tool_call .tool_name == "weather"
342- assert tool_call .arguments == { "city" : "Paris" }
342+ assert "paris" in tool_call .arguments [ "city" ]. lower (), f"Expected 'paris' in city: { tool_call . arguments } "
343343 assert message .meta ["finish_reason" ] == "tool_calls"
344344
345345 @pytest .mark .skipif (
@@ -371,7 +371,12 @@ def test_live_run_with_tools_and_response(self, tools):
371371 assert tool_call .tool_name == "weather"
372372
373373 arguments = [tool_call .arguments for tool_call in tool_calls ]
374- assert sorted (arguments , key = lambda x : x ["city" ]) == [{"city" : "Berlin" }, {"city" : "Paris" }]
374+ # Extract city names and check they contain the expected cities
375+ # (LLM may return "Paris, France" or "Berlin, Germany" instead of just city names)
376+ cities = [arg ["city" ].lower () for arg in arguments ]
377+ assert len (cities ) == 2
378+ assert any ("berlin" in city for city in cities ), f"Expected 'berlin' in one of { cities } "
379+ assert any ("paris" in city for city in cities ), f"Expected 'paris' in one of { cities } "
375380 assert tool_message .meta ["finish_reason" ] == "tool_calls"
376381
377382 new_messages = [
@@ -453,10 +458,9 @@ def test_pipeline_with_openrouter_chat_generator(self, tools):
453458 }
454459 )
455460
456- assert (
457- "The weather in Paris is sunny and 32°C"
458- == results ["tool_invoker" ]["tool_messages" ][0 ].tool_call_result .result
459- )
461+ result = results ["tool_invoker" ]["tool_messages" ][0 ].tool_call_result .result
462+ assert "paris" in result .lower (), f"Expected 'paris' in result: { result } "
463+ assert "sunny and 32°c" in result .lower (), f"Expected 'sunny and 32°c' in result: { result } "
460464
461465 @pytest .mark .skipif (
462466 not os .environ .get ("OPENROUTER_API_KEY" , None ),
0 commit comments