Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 12a0cab

Browse filesBrowse files
authored
Update OpenAI models (empa-scientific-it#301)
1 parent 176e30b commit 12a0cab
Copy full SHA for 12a0cab

File tree

Expand file treeCollapse file tree

2 files changed

+12
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-4
lines changed

‎.gitignore

Copy file name to clipboardExpand all lines: .gitignore
+2Lines 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

Copy file name to clipboardExpand all lines: tutorial/tests/testsuite/ai_helpers.py
+10-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.