From ef5f910f196fb534a8e7ff75a8c510cafb8c5713 Mon Sep 17 00:00:00 2001 From: Leo Li Date: Mon, 13 May 2024 17:28:13 -0400 Subject: [PATCH 1/3] support gpt-4o --- app/constant.ts | 6 +++++- app/utils.ts | 11 ++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/constant.ts b/app/constant.ts index a3d9c206f994..0d37a420b824 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -127,6 +127,8 @@ export const KnowledgeCutOffDate: Record = { "gpt-4-turbo": "2023-12", "gpt-4-turbo-2024-04-09": "2023-12", "gpt-4-turbo-preview": "2023-12", + "gpt-4o": "2023-10", + "gpt-4o-2024-05-13": "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. @@ -144,8 +146,10 @@ const openaiModels = [ "gpt-4-32k-0613", "gpt-4-turbo", "gpt-4-turbo-preview", + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-vision-preview", - "gpt-4-turbo-2024-04-09", + "gpt-4-turbo-2024-04-09" ]; const googleModels = [ diff --git a/app/utils.ts b/app/utils.ts index 07d0dcb13cc5..efcc8c197fe0 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -290,16 +290,13 @@ export function getMessageImages(message: RequestMessage): string[] { } export function isVisionModel(model: string) { - - // Note: This is a better way using the TypeScript feature instead of `&&` or `||` (ts v5.5.0-dev.20240314 I've been using) - const visionKeywords = [ "vision", "claude-3", "gemini-1.5-pro", + "gpt-4-turbo", + "gpt-4o", ]; - const isGpt4Turbo = model.includes("gpt-4-turbo") && !model.includes("preview"); - - return visionKeywords.some((keyword) => model.includes(keyword)) || isGpt4Turbo; -} + return visionKeywords.some((keyword) => model.includes(keyword)); +} \ No newline at end of file From 5df8b1d183ffc657b44f51d280d994da672f1103 Mon Sep 17 00:00:00 2001 From: fred-bf <157469842+fred-bf@users.noreply.github.com> Date: Tue, 14 May 2024 14:32:34 +0800 Subject: [PATCH 2/3] fix: revert gpt-4-turbo-preview detection --- app/utils.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/utils.ts b/app/utils.ts index efcc8c197fe0..d67346a23499 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -297,6 +297,10 @@ export function isVisionModel(model: string) { "gpt-4-turbo", "gpt-4o", ]; + const isGpt4TurboPreview = model === "gpt-4-turbo-preview"; - return visionKeywords.some((keyword) => model.includes(keyword)); -} \ No newline at end of file + return ( + visionKeywords.some((keyword) => model.includes(keyword)) && + !isGpt4TurboPreview + ); +} From 3a007e4f3d8d0ac7be8a8bf08f962101589b1e3c Mon Sep 17 00:00:00 2001 From: fred-bf <157469842+fred-bf@users.noreply.github.com> Date: Tue, 14 May 2024 17:35:58 +0800 Subject: [PATCH 3/3] feat: bump version --- src-tauri/tauri.conf.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 7b00ac17c8fa..ee87d8d15409 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "NextChat", - "version": "2.12.2" + "version": "2.12.3" }, "tauri": { "allowlist": { @@ -112,4 +112,4 @@ } ] } -} \ No newline at end of file +}