server: expose the reasoning effort levels of the chat template (#31271)
* server: expose the reasoning effort levels of the chat template The capability probe renders a user turn for each candidate level (minimal, low, medium, high, xhigh, max) and for an unknown level. A level is honored when it renders without raising and differently from the unknown level, which shows the template fallback. Levels sharing a render are aliases and the highest one is kept. The caps serialize to JSON, and chat_template_caps in /props reports the list as reasoning_effort_levels, from lowest to highest. * jinja: keep the caps free of the json dependency The caps keep reporting their flags as a map, and the effort levels stay a plain member. common_chat_templates_get_caps() builds the JSON the server reports from both, so jinja depends on json only for the probe inputs.
This commit is contained in:
1 parent
a919179942
commit
1b4554eff1
9 files changed
+90
-13
No files matched your search
@@ -1721,7 +1721,7 @@ private:
|
||||
{
|
||||
auto caps = common_chat_templates_get_caps(chat_params.tmpls.get());
|
||||
auto it = params_base.default_template_kwargs.find("preserve_reasoning");
|
||||
bool supported = caps.at("supports_preserve_reasoning");
|
||||
bool supported = caps.at("supports_preserve_reasoning").get<bool>();
|
||||
bool specified = params_base.preserve_reasoning_specified;
|
||||
// note: the kwarg is enabled by default if not specified explicitly, so check the value
|
||||
bool enabled = it != params_base.default_template_kwargs.end() && it->second == "true";
|
||||
|
||||
Reference in new issue
Block a user