From cc9ffdd1c65ded657d7cb8a144cc61c4d8f5ce41 Mon Sep 17 00:00:00 2001 From: Linghui Gong Date: Wed, 14 Aug 2024 22:47:30 +0800 Subject: [PATCH] :sparkles: feat: add 2 new models to openai provider (#3470) --- src/config/modelProviders/openai.ts | 19 ++++++++++++++++++- .../modelList/selectors/modelProvider.test.ts | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/config/modelProviders/openai.ts b/src/config/modelProviders/openai.ts index c8f919b4c21e..b48a46f80460 100644 --- a/src/config/modelProviders/openai.ts +++ b/src/config/modelProviders/openai.ts @@ -24,10 +24,27 @@ const OpenAI: ModelProviderCard = { tokens: 128_000, vision: true, }, + { + description: 'Latest GPT-4o snapshot that supports Structured Outputs', + displayName: 'GPT-4o (240806)', + enabled: true, + functionCall: true, + id: 'gpt-4o-2024-08-06', + tokens: 128_000, + vision: true, + }, + { + description: 'Dynamic model continuously updated to the current version of GPT-4o in ChatGPT', + displayName: 'ChatGPT-4o', + enabled: true, + functionCall: true, + id: 'chatgpt-4o-latest', + tokens: 128_000, + vision: true, + }, { description: 'GPT-4 Turbo with Vision', displayName: 'GPT-4 Turbo', - enabled: true, functionCall: true, id: 'gpt-4-turbo', tokens: 128_000, diff --git a/src/store/user/slices/modelList/selectors/modelProvider.test.ts b/src/store/user/slices/modelList/selectors/modelProvider.test.ts index 0f6045364fdb..38e755741e0a 100644 --- a/src/store/user/slices/modelList/selectors/modelProvider.test.ts +++ b/src/store/user/slices/modelList/selectors/modelProvider.test.ts @@ -49,7 +49,7 @@ describe('modelProviderSelectors', () => { const s = merge(initialState, {}) as unknown as UserStore; const result = modelProviderSelectors.getDefaultEnabledModelsById('openai')(s); - expect(result).toEqual(['gpt-4o-mini', 'gpt-4o', 'gpt-4-turbo']); + expect(result).toEqual(['gpt-4o-mini', 'gpt-4o', 'gpt-4o-2024-08-06', 'chatgpt-4o-latest']); }); it('should return undefined for a non-existing provider', () => {