fix: modifies openai request logic for reasoning models (#4221) (#4294)

Signed-off-by: Matt Yaple <matt@yaple.dev>
This commit is contained in:
Matt Yaple
2025-10-11 23:11:19 +01:00
committed by GitHub
parent 6ed178b2d2
commit 1593b73b0a
+6 -3
View File
@@ -606,10 +606,13 @@ pub fn create_request(
));
}
let is_ox_model =
model_config.model_name.starts_with("o") || model_config.model_name.starts_with("gpt-5");
let is_ox_model = model_config.model_name.starts_with("o1")
|| model_config.model_name.starts_with("o2")
|| model_config.model_name.starts_with("o3")
|| model_config.model_name.starts_with("o4")
|| model_config.model_name.starts_with("gpt-5");
// Only extract reasoning effort for O1/O3 models
// Only extract reasoning effort for O-series models
let (model_name, reasoning_effort) = if is_ox_model {
let parts: Vec<&str> = model_config.model_name.split('-').collect();
let last_part = parts.last().unwrap();