Implement latest GPT-5.1 models
This commit is contained in:
@@ -24,7 +24,7 @@ openai_bp = Blueprint("openai", __name__)
|
||||
|
||||
def _instructions_for_model(model: str) -> str:
|
||||
base = current_app.config.get("BASE_INSTRUCTIONS", BASE_INSTRUCTIONS)
|
||||
if model == "gpt-5-codex":
|
||||
if model == "gpt-5-codex" or model == "gpt-5.1-codex":
|
||||
codex = current_app.config.get("GPT5_CODEX_INSTRUCTIONS") or GPT5_CODEX_INSTRUCTIONS
|
||||
if isinstance(codex, str) and codex.strip():
|
||||
return codex
|
||||
@@ -441,7 +441,10 @@ def list_models() -> Response:
|
||||
expose_variants = bool(current_app.config.get("EXPOSE_REASONING_MODELS"))
|
||||
model_groups = [
|
||||
("gpt-5", ["high", "medium", "low", "minimal"]),
|
||||
("gpt-5.1", ["high", "medium", "low", "minimal"]),
|
||||
("gpt-5-codex", ["high", "medium", "low"]),
|
||||
("gpt-5.1-codex", ["high", "medium", "low"]),
|
||||
("gpt-5.1-codex-mini", []),
|
||||
("codex-mini", []),
|
||||
]
|
||||
model_ids: List[str] = []
|
||||
|
||||
@@ -31,12 +31,15 @@ def normalize_model_name(name: str | None, debug_model: str | None = None) -> st
|
||||
"gpt5": "gpt-5",
|
||||
"gpt-5-latest": "gpt-5",
|
||||
"gpt-5": "gpt-5",
|
||||
"gpt-5.1": "gpt-5.1",
|
||||
"gpt5-codex": "gpt-5-codex",
|
||||
"gpt-5-codex": "gpt-5-codex",
|
||||
"gpt-5-codex-latest": "gpt-5-codex",
|
||||
"gpt-5.1-codex": "gpt-5.1-codex",
|
||||
"codex": "codex-mini-latest",
|
||||
"codex-mini": "codex-mini-latest",
|
||||
"codex-mini-latest": "codex-mini-latest",
|
||||
"gpt-5.1-codex-mini": "gpt-5.1-codex-mini",
|
||||
}
|
||||
return mapping.get(base, base)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user