From 780eb03d9b5da36325ab5ebddbf23bec31a789df Mon Sep 17 00:00:00 2001 From: Chauncey Date: Tue, 14 Oct 2025 18:27:07 +0800 Subject: [PATCH] [CI] Fix test_tool_id_kimi_k2 (#26787) Signed-off-by: chaunceyjiang --- .../openai/test_completion_with_function_calling.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/entrypoints/openai/test_completion_with_function_calling.py b/tests/entrypoints/openai/test_completion_with_function_calling.py index 44d417665537..6833f8d96d1c 100644 --- a/tests/entrypoints/openai/test_completion_with_function_calling.py +++ b/tests/entrypoints/openai/test_completion_with_function_calling.py @@ -247,10 +247,10 @@ async def test_tool_id_kimi_k2( ) assert chat_completion.choices[0].message.tool_calls is not None assert len(chat_completion.choices[0].message.tool_calls) > 0 - assert ( - chat_completion.choices[0].message.tool_calls[0].id - == "functions.get_current_weather:0" - ) + assert chat_completion.choices[0].message.tool_calls[0].id in [ + "functions.get_current_weather:0", + "functions.get_forecast:1", + ] else: # Streaming test output_stream = await k2_client.chat.completions.create( @@ -266,7 +266,10 @@ async def test_tool_id_kimi_k2( if chunk.choices and chunk.choices[0].delta.tool_calls: output.extend(chunk.choices[0].delta.tool_calls) for o in output: - assert o.id is None or o.id == "functions.get_current_weather:0" + assert o.id is None or o.id in [ + "functions.get_current_weather:0", + "functions.get_forecast:1", + ] @pytest.mark.asyncio