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}`;