`chat_template_kwargs`: Allows sending additional parameters to the json templating system. For example: `{"enable_thinking": false}`
+`reasoning_effort`: If set to `none`, reasoning will be disabled for this request. Other values (e.g., `low`, `max`) have no effect on reasoning.
+
`reasoning_format`: The reasoning format to be parsed. If set to `none`, it will output the raw generated text.
`reasoning_control`: Arms realtime reasoning control for this completion so it can be ended early via `/v1/chat/completions/control`. Defaults to `false`.
chatcmpl_body["max_tokens"] = response_body["max_output_tokens"];
}
+ if (response_body.contains("reasoning")) {
+ // Only "effort" is handled so far
+ const json & reasoning = response_body.at("reasoning");
+ if (reasoning.contains("effort")) {
+ chatcmpl_body["reasoning_effort"] = reasoning.at("effort");
+ }
+ chatcmpl_body.erase("reasoning");
+ }
+
return chatcmpl_body;
}
throw std::invalid_argument("invalid type for \"enable_thinking\" (expected boolean, got string)");
}
+ // Parse also the OAI "reasoning_effort": "none" specific value
+ 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.force_pure_content = opt.force_pure_content;
// Apply chat template to the list of messages