mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-08-26 08:44:27 +00:00
chat : pass reasoning_effort to template
* chat: add reasoning_effort to common_chat_templates_inputs Store OpenAI Chat Completions reasoning_effort and make it available to jinja templates (with model specific translations where required). Assisted-by: llama.cpp:Muse-Glimmer-30B * server : fixup reading reasoning effort from body server_chat_convert_responses_to_chatcmpl already handles conversion of Responses API reasoning.effort to reasoning_effort * chat : expose reasoning effort Assisted-by: Claude Opus 5 * chat : add reasoning_effort to generation_params Assisted-by: Claude Opus 5 * chat : move reasoning_effort next to enable_thinking Assisted-by: Claude Opus 5 * cont : mirror preserve_reasoning * cont : pass context through analyze function --------- Co-authored-by: Alde Rojas <hello@alde.dev>
This commit is contained in:
parent
9b05354ec6
commit
7e4c0a9688
9 changed files with 89 additions and 11 deletions
|
|
@ -1292,12 +1292,15 @@ json oaicompat_chat_params_parse(
|
|||
throw std::invalid_argument("invalid type for \"enable_thinking\" (expected boolean, got string)");
|
||||
}
|
||||
|
||||
// Parse also the OAI "reasoning_effort": "none" specific value
|
||||
// Parse the OAI "reasoning_effort" field; "none" disables reasoning.
|
||||
if (body.contains("reasoning_effort")) {
|
||||
auto reasoning_effort = json_value(body, "reasoning_effort", std::string(""));
|
||||
if (reasoning_effort == "none") {
|
||||
inputs.enable_thinking = false;
|
||||
} // other reasoning_effort values are model-specific and not yet handled
|
||||
inputs.chat_template_kwargs.erase("reasoning_effort");
|
||||
} else if (!reasoning_effort.empty()) {
|
||||
inputs.chat_template_kwargs["reasoning_effort"] = json(reasoning_effort).dump();
|
||||
}
|
||||
}
|
||||
|
||||
inputs.force_pure_content = opt.force_pure_content;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue