mirror of
https://github.com/ikawrakow/ik_llama.cpp.git
synced 2026-03-07 12:30:08 +00:00
Allow arbitrary arguments order for Q3C, Q3CN, and Qwen3.5 (#1352)
This should fix the read file at offset/limit issue, where the tool definition has offset before limit, while the model sets limit before offset.
This commit is contained in:
@@ -1250,16 +1250,19 @@ static common_chat_params common_chat_params_init_qwen3_coder_xml(const common_c
|
||||
}
|
||||
|
||||
// build grammar for tool call
|
||||
static const xml_tool_call_format form {
|
||||
/* form.scope_start = */ "",
|
||||
/* form.tool_start = */ "\n<tool_call>\n<function=",
|
||||
/* form.tool_sep = */ ">\n",
|
||||
/* form.key_start = */ "<parameter=",
|
||||
/* form.key_val_sep = */ ">\n",
|
||||
/* form.val_end = */ "\n</parameter>\n",
|
||||
/* form.tool_end = */ "</function>\n</tool_call>",
|
||||
/* form.scope_end = */ "",
|
||||
};
|
||||
static const xml_tool_call_format form = ([]() {
|
||||
xml_tool_call_format form {};
|
||||
form.scope_start = "";
|
||||
form.tool_start = "\n<tool_call>\n<function=";
|
||||
form.tool_sep = ">\n";
|
||||
form.key_start = "<parameter=";
|
||||
form.key_val_sep = ">\n";
|
||||
form.val_end = "\n</parameter>\n";
|
||||
form.tool_end = "</function>\n</tool_call>";
|
||||
form.scope_end = "";
|
||||
form.relax_arg = true;
|
||||
return form;
|
||||
})();
|
||||
build_grammar_xml_tool_call(data, params.tools, form);
|
||||
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user