Skip to content

Commit 5da7766

Browse files
authored
💬 fix: adjust regex in ModelService to recognize o1 models
API query for OpenAI returns list of models. Their names are filtered using a regex. The regex did not yet account for model names starting with o1-
1 parent 519df46 commit 5da7766

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/server/services/ModelService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const fetchOpenAIModels = async (opts, _models = []) => {
157157
}
158158

159159
if (baseURL === openaiBaseURL) {
160-
const regex = /(text-davinci-003|gpt-)/;
160+
const regex = /(text-davinci-003|gpt-|o1-)/;
161161
models = models.filter((model) => regex.test(model));
162162
const instructModels = models.filter((model) => model.includes('instruct'));
163163
const otherModels = models.filter((model) => !model.includes('instruct'));

0 commit comments

Comments
 (0)