Revert "Support OpenAI o3 and o4-mini"

This commit is contained in:
twfz7 2025-04-25 09:01:12 +08:00 committed by GitHub
parent 3809375694
commit 0c91604765
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 7 deletions

View File

@ -198,8 +198,7 @@ export class ChatGPTApi implements LLMApi {
const isDalle3 = _isDalle3(options.config.model); const isDalle3 = _isDalle3(options.config.model);
const isO1OrO3 = const isO1OrO3 =
options.config.model.startsWith("o1") || options.config.model.startsWith("o1") ||
options.config.model.startsWith("o3") || options.config.model.startsWith("o3");
options.config.model.startsWith("o4-mini");
if (isDalle3) { if (isDalle3) {
const prompt = getMessageTextContent( const prompt = getMessageTextContent(
options.messages.slice(-1)?.pop() as any, options.messages.slice(-1)?.pop() as any,
@ -244,7 +243,7 @@ export class ChatGPTApi implements LLMApi {
} }
// add max_tokens to vision model // add max_tokens to vision model
if (visionModel && !isO1OrO3) { if (visionModel) {
requestPayload["max_tokens"] = Math.max(modelConfig.max_tokens, 4000); requestPayload["max_tokens"] = Math.max(modelConfig.max_tokens, 4000);
} }
} }

View File

@ -478,8 +478,6 @@ export const VISION_MODEL_REGEXES = [
/^dall-e-3$/, // Matches exactly "dall-e-3" /^dall-e-3$/, // Matches exactly "dall-e-3"
/glm-4v/, /glm-4v/,
/vl/i, /vl/i,
/o3/,
/o4-mini/,
]; ];
export const EXCLUDE_VISION_MODEL_REGEXES = [/claude-3-5-haiku-20241022/]; export const EXCLUDE_VISION_MODEL_REGEXES = [/claude-3-5-haiku-20241022/];
@ -518,8 +516,6 @@ const openaiModels = [
"o1-mini", "o1-mini",
"o1-preview", "o1-preview",
"o3-mini", "o3-mini",
"o3",
"o4-mini",
]; ];
const googleModels = [ const googleModels = [