From f733852a7258f6ca2db21bd98d35c1336a5f095a Mon Sep 17 00:00:00 2001 From: Lumia <130642629+SpeedupMaster@users.noreply.github.com> Date: Wed, 1 Jan 2025 01:23:50 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20Add=20o1=20model=20in?= =?UTF-8?q?=20openai=20and=20openrouter=20models=20(#5236)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add o1 model in Openai models * Add o1 model in Openrouter models * Update openrouter.ts * Update modelProvider.test.ts --- src/config/modelProviders/openai.ts | 15 +++++++++++++++ src/config/modelProviders/openrouter.ts | 15 +++++++++++++++ .../modelList/selectors/modelProvider.test.ts | 1 + 3 files changed, 31 insertions(+) diff --git a/src/config/modelProviders/openai.ts b/src/config/modelProviders/openai.ts index 14e955652568..da4b52ba5d56 100644 --- a/src/config/modelProviders/openai.ts +++ b/src/config/modelProviders/openai.ts @@ -17,6 +17,21 @@ const OpenAI: ModelProviderCard = { }, releasedAt: '2024-09-12', }, + { + contextWindowTokens: 200_000, + description: + 'o1是OpenAI新的推理模型,支持图文输入并输出文本,适用于需要广泛通用知识的复杂任务。该模型具有200K上下文和2023年10月的知识截止日期。', + displayName: 'OpenAI o1', + enabled: true, + id: 'o1-2024-12-17', + maxOutput: 100_000, + pricing: { + input: 15, + output: 60, + }, + vision: true, + releasedAt: '2024-12-17', + }, { contextWindowTokens: 128_000, description: diff --git a/src/config/modelProviders/openrouter.ts b/src/config/modelProviders/openrouter.ts index d0efaa821b37..9480a1942c37 100644 --- a/src/config/modelProviders/openrouter.ts +++ b/src/config/modelProviders/openrouter.ts @@ -27,6 +27,21 @@ const OpenRouter: ModelProviderCard = { }, releasedAt: '2024-09-12', }, + { + contextWindowTokens: 200_000, + description: + 'o1是OpenAI新的推理模型,支持图文输入并输出文本,适用于需要广泛通用知识的复杂任务。该模型具有200K上下文和2023年10月的知识截止日期。', + displayName: 'OpenAI o1', + enabled: true, + id: 'openai/o1', + maxOutput: 100_000, + pricing: { + input: 15, + output: 60, + }, + releasedAt: '2024-12-17', + vision: true, + }, { contextWindowTokens: 128_000, description: diff --git a/src/store/user/slices/modelList/selectors/modelProvider.test.ts b/src/store/user/slices/modelList/selectors/modelProvider.test.ts index 9287d0cf97fd..d385ea8cb9d9 100644 --- a/src/store/user/slices/modelList/selectors/modelProvider.test.ts +++ b/src/store/user/slices/modelList/selectors/modelProvider.test.ts @@ -51,6 +51,7 @@ describe('modelProviderSelectors', () => { const result = modelProviderSelectors.getDefaultEnabledModelsById('openai')(s); expect(result).toEqual([ 'o1-mini', + 'o1-2024-12-17', 'o1-preview', 'gpt-4o-mini', 'gpt-4o-2024-11-20',