Skip to content

Commit 12a0cab

Browse files
authored
Update OpenAI models (#301)
1 parent 176e30b commit 12a0cab

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,5 @@ dmypy.json
135135
*.html
136136
.idea/
137137
drafts/
138+
.virtual_documents
139+
.zed

tutorial/tests/testsuite/ai_helpers.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,14 @@ class OpenAIWrapper:
6464
"""A simple API wrapper adapted for IPython environments"""
6565

6666
# These are the models we can use: they must support structured responses
67-
GPT_STABLE_MODELS = ("gpt-3.5-turbo", "gpt-4", "gpt-4o", "gpt-4o-mini")
68-
GPT_ALL_MODELS = GPT_STABLE_MODELS
67+
GPT_MODELS = (
68+
"gpt-4o",
69+
"gpt-4o-mini",
70+
"gpt-4.1",
71+
"gpt-4.1-mini",
72+
"gpt-4.1-nano",
73+
"o4-mini",
74+
)
6975

7076
DEFAULT_MODEL = "gpt-4o-mini"
7177
DEFAULT_LANGUAGE = "English"
@@ -134,11 +140,11 @@ def validate_api_key(cls, api_key: t.Optional[str]) -> ValidationResult:
134140
def validate_model(self, model: t.Optional[str]) -> ValidationResult:
135141
"""Validate the model selection"""
136142
try:
137-
if model not in self.GPT_ALL_MODELS:
143+
if model not in self.GPT_MODELS:
138144
return ValidationResult(
139145
is_valid=False,
140146
error=InvalidModelError(),
141-
message=f"Invalid model: {model}. Available models: {' '.join(self.GPT_ALL_MODELS)}",
147+
message=f"Invalid model: {model}. Available models: {' '.join(self.GPT_MODELS)}",
142148
)
143149
except Exception as e:
144150
return ValidationResult(

0 commit comments

Comments
 (0)