server: support "reasoning_effort": "none" in OAI API (#26045)
* support "reasoning_effort": "none" in OAI API * handle reasoning.effort: "none" in OAI responses API * clarify non-"none" values of reasoning_effort have no effect * use json_value instead of body.at
This commit is contained in:
@@ -283,6 +283,15 @@ json server_chat_convert_responses_to_chatcmpl(const json & response_body) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user