From 9caf820758a1c7b22a25d70ae9be0e4600563f87 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Fri, 19 Jul 2024 01:54:40 +0800 Subject: [PATCH] Add GPT-4o mini support Reference: - https://platform.openai.com/docs/models/gpt-4o-mini - https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/ --- app/constant.ts | 4 ++++ app/utils.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/app/constant.ts b/app/constant.ts index e0b3d227eab..9d544f53405 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -182,6 +182,8 @@ export const KnowledgeCutOffDate: Record = { "gpt-4-turbo-preview": "2023-12", "gpt-4o": "2023-10", "gpt-4o-2024-05-13": "2023-10", + "gpt-4o-mini": "2023-10", + "gpt-4o-mini-2024-07-18": "2023-10", "gpt-4-vision-preview": "2023-04", // After improvements, // it's now easier to add "KnowledgeCutOffDate" instead of stupid hardcoding it, as was done previously. @@ -201,6 +203,8 @@ const openaiModels = [ "gpt-4-turbo-preview", "gpt-4o", "gpt-4o-2024-05-13", + "gpt-4o-mini", + "gpt-4o-mini-2024-07-18", "gpt-4-vision-preview", "gpt-4-turbo-2024-04-09", "gpt-4-1106-preview", diff --git a/app/utils.ts b/app/utils.ts index 8f7adc7e2a2..2f2c8ae95ab 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -256,6 +256,7 @@ export function isVisionModel(model: string) { "gemini-1.5-pro", "gemini-1.5-flash", "gpt-4o", + "gpt-4o-mini", ]; const isGpt4Turbo = model.includes("gpt-4-turbo") && !model.includes("preview");