mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 07:15:01 +08:00
[CI] Fix test_tool_id_kimi_k2 (#26787)
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
This commit is contained in:
parent
ef9676a1f1
commit
780eb03d9b
@ -247,10 +247,10 @@ async def test_tool_id_kimi_k2(
|
|||||||
)
|
)
|
||||||
assert chat_completion.choices[0].message.tool_calls is not None
|
assert chat_completion.choices[0].message.tool_calls is not None
|
||||||
assert len(chat_completion.choices[0].message.tool_calls) > 0
|
assert len(chat_completion.choices[0].message.tool_calls) > 0
|
||||||
assert (
|
assert chat_completion.choices[0].message.tool_calls[0].id in [
|
||||||
chat_completion.choices[0].message.tool_calls[0].id
|
"functions.get_current_weather:0",
|
||||||
== "functions.get_current_weather:0"
|
"functions.get_forecast:1",
|
||||||
)
|
]
|
||||||
else:
|
else:
|
||||||
# Streaming test
|
# Streaming test
|
||||||
output_stream = await k2_client.chat.completions.create(
|
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:
|
if chunk.choices and chunk.choices[0].delta.tool_calls:
|
||||||
output.extend(chunk.choices[0].delta.tool_calls)
|
output.extend(chunk.choices[0].delta.tool_calls)
|
||||||
for o in output:
|
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
|
@pytest.mark.asyncio
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user