fix(llms): narrow _is_reasoning_model to not match gpt-5.x variants (#4746)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Rudrasinh Nimeshkumar Ravalji
2026-04-23 18:58:12 +05:30
committed by GitHub
co-authored by Claude
parent 282feaebf2
commit 15feaa8ac4
2 changed files with 54 additions and 6 deletions
+11 -6
View File
@@ -54,14 +54,19 @@ class LLMBase(ABC):
"o1", "o1-preview", "o3-mini", "o3",
"gpt-5", "gpt-5o", "gpt-5o-mini", "gpt-5o-micro",
}
if model.lower() in reasoning_models:
return True
model_lower = model.lower()
if any(reasoning_model in model_lower for reasoning_model in ["gpt-5", "o1", "o3"]):
# Strip provider prefixes (e.g. "openai/o3-mini" -> "o3-mini")
base_model = model_lower.rsplit("/", 1)[-1]
if base_model in reasoning_models:
return True
# Match o1/o3 family with prefixes (o1-2024-12-17, o3-2025-04-16)
# but NOT gpt-5.x variants (gpt-5.4-mini supports temperature)
if any(base_model.startswith(prefix) for prefix in ["o1-", "o1.", "o3-", "o3."]):
return True
return False
def _get_supported_params(self, **kwargs) -> Dict: