From 21653b09fc447bfcd43317825c7fa4859b9fb5da Mon Sep 17 00:00:00 2001 From: Sean Hatfield Date: Fri, 26 Jan 2024 13:03:50 -0800 Subject: [PATCH] [FEAT] add gpt-4-turbo-preview (#651) * add gpt-4-turbo-preview * add gpt-4-turbo-preview to valid models --- frontend/src/components/LLMSelection/OpenAiOptions/index.jsx | 1 + .../Settings/ChatModelPreference/useGetProviderModels.js | 1 + server/utils/AiProviders/openAi/index.js | 3 +++ 3 files changed, 5 insertions(+) diff --git a/frontend/src/components/LLMSelection/OpenAiOptions/index.jsx b/frontend/src/components/LLMSelection/OpenAiOptions/index.jsx index ffc0f91e1f..b1718afe90 100644 --- a/frontend/src/components/LLMSelection/OpenAiOptions/index.jsx +++ b/frontend/src/components/LLMSelection/OpenAiOptions/index.jsx @@ -85,6 +85,7 @@ function OpenAIModelSelection({ apiKey, settings }) { "gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", + "gpt-4-turbo-preview", "gpt-4-1106-preview", "gpt-4-32k", ].map((model) => { diff --git a/frontend/src/components/Modals/MangeWorkspace/Settings/ChatModelPreference/useGetProviderModels.js b/frontend/src/components/Modals/MangeWorkspace/Settings/ChatModelPreference/useGetProviderModels.js index 270f8a968e..1f8cce9889 100644 --- a/frontend/src/components/Modals/MangeWorkspace/Settings/ChatModelPreference/useGetProviderModels.js +++ b/frontend/src/components/Modals/MangeWorkspace/Settings/ChatModelPreference/useGetProviderModels.js @@ -8,6 +8,7 @@ const PROVIDER_DEFAULT_MODELS = { "gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", + "gpt-4-turbo-preview", "gpt-4-1106-preview", "gpt-4-32k", ], diff --git a/server/utils/AiProviders/openAi/index.js b/server/utils/AiProviders/openAi/index.js index a25f69eade..120e728448 100644 --- a/server/utils/AiProviders/openAi/index.js +++ b/server/utils/AiProviders/openAi/index.js @@ -52,6 +52,8 @@ class OpenAiLLM { return 8192; case "gpt-4-1106-preview": return 128000; + case "gpt-4-turbo-preview": + return 128000; case "gpt-4-32k": return 32000; default: @@ -65,6 +67,7 @@ class OpenAiLLM { "gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4-1106-preview", + "gpt-4-turbo-preview", "gpt-4-32k", ]; const isPreset = validModels.some((model) => modelName === model);