feat: Added support for modifying the reasoning effort of reasoning models

This commit is contained in:
2026-07-16 12:28:04 -06:00
parent e9c52566b8
commit e9a8c01dc4
18 changed files with 353 additions and 3 deletions
+8
View File
@@ -356,6 +356,7 @@ pub fn openai_build_chat_completions_body(data: ChatCompletionsData, model: &Mod
messages,
temperature,
top_p,
reasoning_effort,
functions,
stream,
} = data;
@@ -454,6 +455,9 @@ pub fn openai_build_chat_completions_body(data: ChatCompletionsData, model: &Mod
if let Some(v) = top_p {
body["top_p"] = v.into();
}
if let Some(v) = reasoning_effort {
body["reasoning_effort"] = v.into();
}
if stream {
body["stream"] = true.into();
}
@@ -534,6 +538,7 @@ pub fn openai_build_responses_body(data: ChatCompletionsData, model: &Model) ->
messages,
temperature,
top_p,
reasoning_effort,
functions,
stream,
} = data;
@@ -590,6 +595,9 @@ pub fn openai_build_responses_body(data: ChatCompletionsData, model: &Model) ->
if let Some(v) = top_p {
body["top_p"] = v.into();
}
if let Some(v) = reasoning_effort {
body["reasoning"] = json!({ "effort": v });
}
if stream {
body["stream"] = true.into();
}