Fix Kimi2 parsing issues (#989)

* Fix Kimi2 chat parse

* Add @hksdpc255's junja templates

* Fix junja -> junja

---------

Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
This commit is contained in:
Kawrakow
2025-11-20 10:08:02 +01:00
committed by GitHub
parent 0f6986a33c
commit 1128a55b0a
3 changed files with 175 additions and 2 deletions

View File

@@ -1646,8 +1646,8 @@ static void common_chat_parse_kimi_k2(common_chat_msg_parser & builder) {
form.tool_start = "<|tool_call_begin|>";
form.tool_sep = "<|tool_call_argument_begin|>{";
form.key_start = "\"";
form.key_val_sep = "\": ";
form.val_end = ", ";
form.key_val_sep = "\":";
form.val_end = ",";
form.tool_end = "}<|tool_call_end|>";
form.scope_end = "<|tool_calls_section_end|>";
form.raw_argval = false;