fix: cover o1 max-completion token fallback
Maintainer edit: keep the GPT-5/o-series fallback on slug-boundary matching so unrelated model names are not caught by substring checks, and include o1 alongside o3/o4 because it is also an o-series chat model.
This commit is contained in:
@@ -94,10 +94,10 @@ def _model_slug(model_name: str) -> str:
|
||||
|
||||
|
||||
def _requires_max_completion_tokens(model_name: str) -> bool:
|
||||
"""Return True for models that reject ``max_tokens`` (GPT-5 family, o3/o4)."""
|
||||
"""Return True for models that reject ``max_tokens`` (GPT-5 family, o-series)."""
|
||||
slug = _model_slug(model_name)
|
||||
return "gpt-5" in slug or any(
|
||||
slug == p or slug.startswith((p + "-", p + ".")) for p in ("o3", "o4")
|
||||
slug == p or slug.startswith((p + "-", p + ".")) for p in ("o1", "o3", "o4")
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user