Add back the fix for Kimi-K2 tool-call parsing issues (#1070)

Co-authored-by: firecoperana <firecoperana>
This commit is contained in:
firecoperana
2025-12-16 07:44:47 -06:00
committed by GitHub
parent 090f354d33
commit 269cc761db

View File

@@ -918,12 +918,13 @@ static void common_chat_parse_kimi_k2(common_chat_msg_parser & builder) {
form.tool_start = "<|tool_call_begin|>"; form.tool_start = "<|tool_call_begin|>";
form.tool_sep = "<|tool_call_argument_begin|>{"; form.tool_sep = "<|tool_call_argument_begin|>{";
form.key_start = "\""; form.key_start = "\"";
form.key_val_sep = "\": "; form.key_val_sep = "\":";
form.val_end = ", "; form.val_end = ",";
form.tool_end = "}<|tool_call_end|>"; form.tool_end = "}<|tool_call_end|>";
form.scope_end = "<|tool_calls_section_end|>"; form.scope_end = "<|tool_calls_section_end|>";
form.raw_argval = false; form.raw_argval = false;
form.last_val_end = ""; form.last_val_end = "";
form.allow_toolcall_in_think = true;
return form; return form;
})(); })();
builder.consume_reasoning_with_xml_tool_calls(form, "<think>", "</think>"); builder.consume_reasoning_with_xml_tool_calls(form, "<think>", "</think>");