diff --git a/app/api/openai.ts b/app/api/openai.ts index 0059ff8b4230..7dfd84e17859 100644 --- a/app/api/openai.ts +++ b/app/api/openai.ts @@ -13,7 +13,9 @@ function getModels(remoteModelRes: OpenAIListModelResponse) { if (config.disableGPT4) { remoteModelRes.data = remoteModelRes.data.filter( - (m) => !m.id.startsWith("gpt-4") || m.id.startsWith("gpt-4o-mini"), + (m) => + !(m.id.startsWith("gpt-4") || m.id.startsWith("chatgpt-4o")) || + m.id.startsWith("gpt-4o-mini"), ); } diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index 780ef0676dd5..4d6f28845412 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -407,7 +407,9 @@ export class ChatGPTApi implements LLMApi { }); const resJson = (await res.json()) as OpenAIListModelResponse; - const chatModels = resJson.data?.filter((m) => m.id.startsWith("gpt-")); + const chatModels = resJson.data?.filter( + (m) => m.id.startsWith("gpt-") || m.id.startsWith("chatgpt-"), + ); console.log("[Models]", chatModels); if (!chatModels) { diff --git a/app/components/emoji.tsx b/app/components/emoji.tsx index 3b1f5e7516b7..6db746c462ca 100644 --- a/app/components/emoji.tsx +++ b/app/components/emoji.tsx @@ -36,7 +36,8 @@ export function Avatar(props: { model?: ModelType; avatar?: string }) { if (props.model) { return (
- {props.model?.startsWith("gpt-4") ? ( + {props.model?.startsWith("gpt-4") || + props.model?.startsWith("chatgpt-4o") ? ( ) : ( diff --git a/app/config/server.ts b/app/config/server.ts index e953af369fa0..676b0174f24b 100644 --- a/app/config/server.ts +++ b/app/config/server.ts @@ -120,12 +120,15 @@ export const getServerSideConfig = () => { if (disableGPT4) { if (customModels) customModels += ","; customModels += DEFAULT_MODELS.filter( - (m) => m.name.startsWith("gpt-4") && !m.name.startsWith("gpt-4o-mini"), + (m) => + (m.name.startsWith("gpt-4") || m.name.startsWith("chatgpt-4o")) && + !m.name.startsWith("gpt-4o-mini"), ) .map((m) => "-" + m.name) .join(","); if ( - defaultModel.startsWith("gpt-4") && + (defaultModel.startsWith("gpt-4") || + defaultModel.startsWith("chatgpt-4o")) && !defaultModel.startsWith("gpt-4o-mini") ) defaultModel = ""; diff --git a/app/constant.ts b/app/constant.ts index 90557c16c725..eb82d3c66002 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -246,6 +246,7 @@ export const KnowledgeCutOffDate: Record = { "gpt-4o": "2023-10", "gpt-4o-2024-05-13": "2023-10", "gpt-4o-2024-08-06": "2023-10", + "chatgpt-4o-latest": "2023-10", "gpt-4o-mini": "2023-10", "gpt-4o-mini-2024-07-18": "2023-10", "gpt-4-vision-preview": "2023-04", @@ -268,6 +269,7 @@ const openaiModels = [ "gpt-4o", "gpt-4o-2024-05-13", "gpt-4o-2024-08-06", + "chatgpt-4o-latest", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-vision-preview", diff --git a/app/store/chat.ts b/app/store/chat.ts index 8b0cc39eb627..96cc402523b9 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -106,7 +106,7 @@ function createEmptySession(): ChatSession { function getSummarizeModel(currentModel: string) { // if it is using gpt-* models, force to use 4o-mini to summarize - if (currentModel.startsWith("gpt")) { + if (currentModel.startsWith("gpt") || currentModel.startsWith("chatgpt")) { const configStore = useAppConfig.getState(); const accessStore = useAccessStore.getState(); const allModel = collectModelsWithDefaultModel( @@ -476,7 +476,8 @@ export const useChatStore = createPersistStore( // system prompts, to get close to OpenAI Web ChatGPT const shouldInjectSystemPrompts = modelConfig.enableInjectSystemPrompts && - session.mask.modelConfig.model.startsWith("gpt-"); + (session.mask.modelConfig.model.startsWith("gpt-") || + session.mask.modelConfig.model.startsWith("chatgpt-")); var systemPrompts: ChatMessage[] = []; systemPrompts = shouldInjectSystemPrompts