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
+4
View File
@@ -334,6 +334,7 @@ pub fn gemini_build_chat_completions_body(
mut messages,
temperature,
top_p,
reasoning_effort,
functions,
stream: _,
} = data;
@@ -426,6 +427,9 @@ pub fn gemini_build_chat_completions_body(
if let Some(v) = top_p {
body["generationConfig"]["topP"] = v.into();
}
if let Some(v) = reasoning_effort {
body["generation_config"]["thinking_level"] = v.into();
}
if let Some(functions) = functions {
// Gemini doesn't support functions with parameters that have empty properties, so we need to patch it.