diff --git a/src/api/api.ts b/src/api/api.ts index 20073cf..68c308f 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -18,9 +18,8 @@ export const getChatCompletion = async ( if (isAzureEndpoint(endpoint) && apiKey) { headers['api-key'] = apiKey; - const gpt3forAzure = 'gpt-35-turbo'; - const model = - config.model === 'gpt-3.5-turbo' ? gpt3forAzure : config.model; + const model = config.model === 'gpt-3.5-turbo' ? 'gpt-35-turbo' : config.model === 'gpt-3.5-turbo-16k' ? 'gpt-35-turbo-16k' : config.model; + const apiVersion = '2023-03-15-preview'; const path = `openai/deployments/${model}/chat/completions?api-version=${apiVersion}`; @@ -64,9 +63,8 @@ export const getChatCompletionStream = async ( if (isAzureEndpoint(endpoint) && apiKey) { headers['api-key'] = apiKey; - const gpt3forAzure = 'gpt-35-turbo'; - const model = - config.model === 'gpt-3.5-turbo' ? gpt3forAzure : config.model; + const model = config.model === 'gpt-3.5-turbo' ? 'gpt-35-turbo' : config.model === 'gpt-3.5-turbo-16k' ? 'gpt-35-turbo-16k' : config.model; + const apiVersion = '2023-03-15-preview'; const path = `openai/deployments/${model}/chat/completions?api-version=${apiVersion}`;