[Fix] correct tool_id for kimi-k2 when use tool_choice=required (#21259)

Co-authored-by: wangzhengtao <wangzhengtao@msh.team>
This commit is contained in:
bigmoyan
2025-08-20 12:59:54 -07:00
committed by GitHub
co-authored by wangzhengtao
parent 0cdbf5e61c
commit 582bbe6bd7
15 changed files with 283 additions and 166 deletions
@@ -8,7 +8,7 @@ from typing import Any, Optional
import regex as re
from transformers import PreTrainedTokenizerBase
from vllm.entrypoints.chat_utils import random_tool_call_id
from vllm.entrypoints.chat_utils import make_tool_call_id
from vllm.entrypoints.openai.protocol import (ChatCompletionRequest,
DeltaMessage,
ExtractedToolCallInformation,
@@ -74,7 +74,7 @@ class Phi4MiniJsonToolParser(ToolParser):
tool_calls: list[ToolCall] = [
ToolCall(
id=random_tool_call_id(),
id=make_tool_call_id(),
type="function",
function=FunctionCall(
name=raw_function_call["name"],