[Frontend] Fix Kimi K2 tool call IDs for required tool choice (#46344)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
This commit is contained in:
Chauncey
2026-06-24 19:59:40 +00:00
committed by GitHub
parent 49f2104c53
commit 84c2f9f0fb
11 changed files with 406 additions and 178 deletions
+1 -7
View File
@@ -45,7 +45,6 @@ def build_response_output_items(
content: str | None,
tool_calls: list[FunctionCall] | None,
logprobs: list[Logprob] | None = None,
tool_call_id_type: str = "random",
) -> list[ResponseOutputItem]:
outputs: list[ResponseOutputItem] = []
@@ -86,12 +85,7 @@ def build_response_output_items(
ResponseFunctionToolCall(
id=f"fc_{random_uuid()}",
call_id=tool_call.id
if tool_call.id
else make_tool_call_id(
id_type=tool_call_id_type,
func_name=tool_call.name,
idx=idx,
),
or make_tool_call_id(func_name=tool_call.name, idx=idx),
type="function_call",
status="completed",
name=tool_call.name,