This commit is contained in:
@@ -9,6 +9,7 @@ from .model_registry import normalize_model_name
|
||||
PRIORITY_SUPPORTED_MODELS = frozenset(
|
||||
(
|
||||
"gpt-5.4",
|
||||
"gpt-5.5",
|
||||
"gpt-5.2",
|
||||
"gpt-5.1",
|
||||
"gpt-5",
|
||||
|
||||
@@ -16,6 +16,7 @@ class ModelSpec:
|
||||
allowed_efforts: frozenset[str]
|
||||
variant_efforts: tuple[str, ...]
|
||||
uses_codex_instructions: bool = False
|
||||
preset_effort: str | None = None
|
||||
|
||||
|
||||
_MODEL_SPECS = (
|
||||
@@ -61,6 +62,14 @@ _MODEL_SPECS = (
|
||||
allowed_efforts=frozenset(("none", "low", "medium", "high", "xhigh")),
|
||||
variant_efforts=("xhigh", "high", "medium", "low", "none"),
|
||||
),
|
||||
ModelSpec(
|
||||
public_id="gpt-5.5-pro",
|
||||
upstream_id="gpt-5.5",
|
||||
aliases=("gpt5.5-pro", "gpt-5.5-pro-latest"),
|
||||
allowed_efforts=frozenset(("none", "low", "medium", "high", "xhigh")),
|
||||
variant_efforts=(),
|
||||
preset_effort="xhigh",
|
||||
),
|
||||
ModelSpec(
|
||||
public_id="gpt-5.3-codex",
|
||||
upstream_id="gpt-5.3-codex",
|
||||
@@ -127,12 +136,12 @@ _MODEL_SPECS = (
|
||||
),
|
||||
)
|
||||
|
||||
_SPECS_BY_UPSTREAM = {spec.upstream_id: spec for spec in _MODEL_SPECS}
|
||||
_SPECS_BY_PUBLIC_ID = {spec.public_id: spec for spec in _MODEL_SPECS}
|
||||
_ALIASES = {}
|
||||
for _spec in _MODEL_SPECS:
|
||||
_ALIASES[_spec.public_id] = _spec.upstream_id
|
||||
_ALIASES[_spec.public_id] = _spec.public_id
|
||||
for _alias in _spec.aliases:
|
||||
_ALIASES[_alias] = _spec.upstream_id
|
||||
_ALIASES[_alias] = _spec.public_id
|
||||
|
||||
|
||||
def _strip_model_name(model: str | None) -> tuple[str, str | None]:
|
||||
@@ -155,10 +164,10 @@ def _strip_model_name(model: str | None) -> tuple[str, str | None]:
|
||||
|
||||
def model_spec_for_name(model: str | None) -> ModelSpec | None:
|
||||
base, _ = _strip_model_name(model)
|
||||
upstream_id = _ALIASES.get(base)
|
||||
if not upstream_id:
|
||||
public_id = _ALIASES.get(base)
|
||||
if not public_id:
|
||||
return None
|
||||
return _SPECS_BY_UPSTREAM.get(upstream_id)
|
||||
return _SPECS_BY_PUBLIC_ID.get(public_id)
|
||||
|
||||
|
||||
def normalize_model_name(model: str | None, debug_model: str | None = None) -> str:
|
||||
@@ -187,6 +196,9 @@ def allowed_efforts_for_model(model: str | None) -> frozenset[str]:
|
||||
|
||||
def extract_reasoning_from_model_name(model: str | None) -> dict[str, str] | None:
|
||||
_, effort = _strip_model_name(model)
|
||||
if not effort:
|
||||
spec = model_spec_for_name(model)
|
||||
effort = spec.preset_effort if spec is not None else None
|
||||
if not effort:
|
||||
return None
|
||||
return {"effort": effort}
|
||||
|
||||
Reference in New Issue
Block a user