Skip to content

Commit 3809375

Browse files
authored
Merge pull request #6457 from ACTOR-ALCHEMIST/main
Support OpenAI o3 and o4-mini
2 parents 1b0de25 + 2d7229d commit 3809375

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

app/client/platforms/openai.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ export class ChatGPTApi implements LLMApi {
198198
const isDalle3 = _isDalle3(options.config.model);
199199
const isO1OrO3 =
200200
options.config.model.startsWith("o1") ||
201-
options.config.model.startsWith("o3");
201+
options.config.model.startsWith("o3") ||
202+
options.config.model.startsWith("o4-mini");
202203
if (isDalle3) {
203204
const prompt = getMessageTextContent(
204205
options.messages.slice(-1)?.pop() as any,
@@ -243,7 +244,7 @@ export class ChatGPTApi implements LLMApi {
243244
}
244245

245246
// add max_tokens to vision model
246-
if (visionModel) {
247+
if (visionModel && !isO1OrO3) {
247248
requestPayload["max_tokens"] = Math.max(modelConfig.max_tokens, 4000);
248249
}
249250
}

app/constant.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@ export const VISION_MODEL_REGEXES = [
478478
/^dall-e-3$/, // Matches exactly "dall-e-3"
479479
/glm-4v/,
480480
/vl/i,
481+
/o3/,
482+
/o4-mini/,
481483
];
482484

483485
export const EXCLUDE_VISION_MODEL_REGEXES = [/claude-3-5-haiku-20241022/];
@@ -516,6 +518,8 @@ const openaiModels = [
516518
"o1-mini",
517519
"o1-preview",
518520
"o3-mini",
521+
"o3",
522+
"o4-mini",
519523
];
520524

521525
const googleModels = [

0 commit comments

Comments
 (0)