Skip to content

Commit b4df562

Browse files
committed
fix: correct model name gpt-5.1-mini to gpt-5.1-codex-mini
Fixes #2785 The model string `gpt-5.1-mini` was incorrectly listed in the ChatModel type. It should be `gpt-5.1-codex-mini` to match the actual model naming. Changes: - Updated gpt-5.1-mini to gpt-5.1-codex-mini in: - src/openai/types/shared/chat_model.py - src/openai/types/shared_params/chat_model.py - src/openai/resources/responses/responses.py - src/openai/types/responses/response_compact_params.py - Added test to verify the correct model name
1 parent f94256d commit b4df562

File tree

5 files changed

+60
-5
lines changed

5 files changed

+60
-5
lines changed

src/openai/resources/responses/responses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ def compact(
15361536
"gpt-5.1",
15371537
"gpt-5.1-2025-11-13",
15381538
"gpt-5.1-codex",
1539-
"gpt-5.1-mini",
1539+
"gpt-5.1-codex-mini",
15401540
"gpt-5.1-chat-latest",
15411541
"gpt-5",
15421542
"gpt-5-mini",
@@ -3154,7 +3154,7 @@ async def compact(
31543154
"gpt-5.1",
31553155
"gpt-5.1-2025-11-13",
31563156
"gpt-5.1-codex",
3157-
"gpt-5.1-mini",
3157+
"gpt-5.1-codex-mini",
31583158
"gpt-5.1-chat-latest",
31593159
"gpt-5",
31603160
"gpt-5-mini",

src/openai/types/responses/response_compact_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ResponseCompactParams(TypedDict, total=False):
2222
"gpt-5.1",
2323
"gpt-5.1-2025-11-13",
2424
"gpt-5.1-codex",
25-
"gpt-5.1-mini",
25+
"gpt-5.1-codex-mini",
2626
"gpt-5.1-chat-latest",
2727
"gpt-5",
2828
"gpt-5-mini",

src/openai/types/shared/chat_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"gpt-5.1",
1414
"gpt-5.1-2025-11-13",
1515
"gpt-5.1-codex",
16-
"gpt-5.1-mini",
16+
"gpt-5.1-codex-mini",
1717
"gpt-5.1-chat-latest",
1818
"gpt-5",
1919
"gpt-5-mini",

src/openai/types/shared_params/chat_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"gpt-5.1",
1616
"gpt-5.1-2025-11-13",
1717
"gpt-5.1-codex",
18-
"gpt-5.1-mini",
18+
"gpt-5.1-codex-mini",
1919
"gpt-5.1-chat-latest",
2020
"gpt-5",
2121
"gpt-5-mini",

tests/test_chat_model_types.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"""Tests for ChatModel type definitions.
2+
3+
Verifies that the ChatModel type includes correct model names.
4+
Relates to issue #2785: GPT 5.1 Mini wrongly listed in model list
5+
"""
6+
7+
import pytest
8+
from typing import get_args
9+
10+
from openai.types.shared import ChatModel
11+
12+
13+
class TestChatModelTypes:
14+
"""Test ChatModel type definitions."""
15+
16+
def test_gpt_5_1_codex_mini_exists(self) -> None:
17+
"""Verify gpt-5.1-codex-mini is in ChatModel (fixes #2785)."""
18+
# Get all valid ChatModel values
19+
valid_models = get_args(ChatModel)
20+
21+
# gpt-5.1-codex-mini should exist (not gpt-5.1-mini)
22+
assert "gpt-5.1-codex-mini" in valid_models, (
23+
"gpt-5.1-codex-mini should be in ChatModel"
24+
)
25+
26+
def test_gpt_5_1_mini_not_exists(self) -> None:
27+
"""Verify gpt-5.1-mini is NOT in ChatModel (was incorrect)."""
28+
valid_models = get_args(ChatModel)
29+
30+
# gpt-5.1-mini should NOT exist (it was wrongly listed)
31+
assert "gpt-5.1-mini" not in valid_models, (
32+
"gpt-5.1-mini should NOT be in ChatModel (issue #2785)"
33+
)
34+
35+
def test_gpt_5_1_codex_exists(self) -> None:
36+
"""Verify gpt-5.1-codex is in ChatModel."""
37+
valid_models = get_args(ChatModel)
38+
assert "gpt-5.1-codex" in valid_models
39+
40+
def test_gpt_5_family_models_exist(self) -> None:
41+
"""Verify GPT-5 family models are present."""
42+
valid_models = get_args(ChatModel)
43+
44+
expected_gpt5_models = [
45+
"gpt-5",
46+
"gpt-5-mini",
47+
"gpt-5-nano",
48+
"gpt-5.1",
49+
"gpt-5.1-codex",
50+
"gpt-5.1-codex-mini",
51+
"gpt-5.2",
52+
]
53+
54+
for model in expected_gpt5_models:
55+
assert model in valid_models, f"{model} should be in ChatModel"

0 commit comments

Comments
 (0)