From 2e27f253dc4cae09086cb1713c8a087dbdfa0bfa Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Sat, 11 Nov 2023 18:16:39 +0800 Subject: [PATCH] update azure endpoint --- src/api/api.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/api/api.ts b/src/api/api.ts index 54bf97c1a..f4f8509e9 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -21,15 +21,13 @@ export const getChatCompletion = async ( const modelmapping: Partial> = { 'gpt-3.5-turbo': 'gpt-35-turbo', 'gpt-3.5-turbo-16k': 'gpt35-turbo-16k', - 'gpt-4': 'gpt4-4', - 'gpt-4-32k': 'gpt4-4-32k', }; const model = modelmapping[config.model] || config.model; // set api version to 2023-07-01-preview for gpt-4 and gpt-4-32k, otherwise use 2023-03-15-preview const apiVersion = - model === 'gpt4-4' || model === 'gpt4-4-32k' + model === 'gpt-4' || model === 'gpt-4-32k' ? '2023-07-01-preview' : '2023-03-15-preview'; @@ -77,15 +75,13 @@ export const getChatCompletionStream = async ( const modelmapping: Partial> = { 'gpt-3.5-turbo': 'gpt-35-turbo', 'gpt-3.5-turbo-16k': 'gpt35-turbo-16k', - 'gpt-4': 'gpt4-4', - 'gpt-4-32k': 'gpt4-4-32k', }; const model = modelmapping[config.model] || config.model; // set api version to 2023-07-01-preview for gpt-4 and gpt-4-32k, otherwise use 2023-03-15-preview const apiVersion = - model === 'gpt4-4' || model === 'gpt4-4-32k' + model === 'gpt-4' || model === 'gpt-4-32k' ? '2023-07-01-preview' : '2023-03-15-preview'; const path = `openai/deployments/${model}/chat/completions?api-version=${apiVersion}`;