mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 18:33:59 +01:00
Azure OpenAI API fix for gpt-3.5-turbo-16k (#383)
Signed-off-by: Xtrah <12988459+Xtrah@users.noreply.github.com>
This commit is contained in:
parent
d0ddcfea6a
commit
34773212ea
|
@ -18,9 +18,8 @@ export const getChatCompletion = async (
|
||||||
if (isAzureEndpoint(endpoint) && apiKey) {
|
if (isAzureEndpoint(endpoint) && apiKey) {
|
||||||
headers['api-key'] = apiKey;
|
headers['api-key'] = apiKey;
|
||||||
|
|
||||||
const gpt3forAzure = 'gpt-35-turbo';
|
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 model =
|
|
||||||
config.model === 'gpt-3.5-turbo' ? gpt3forAzure : config.model;
|
|
||||||
const apiVersion = '2023-03-15-preview';
|
const apiVersion = '2023-03-15-preview';
|
||||||
|
|
||||||
const path = `openai/deployments/${model}/chat/completions?api-version=${apiVersion}`;
|
const path = `openai/deployments/${model}/chat/completions?api-version=${apiVersion}`;
|
||||||
|
@ -64,9 +63,8 @@ export const getChatCompletionStream = async (
|
||||||
if (isAzureEndpoint(endpoint) && apiKey) {
|
if (isAzureEndpoint(endpoint) && apiKey) {
|
||||||
headers['api-key'] = apiKey;
|
headers['api-key'] = apiKey;
|
||||||
|
|
||||||
const gpt3forAzure = 'gpt-35-turbo';
|
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 model =
|
|
||||||
config.model === 'gpt-3.5-turbo' ? gpt3forAzure : config.model;
|
|
||||||
const apiVersion = '2023-03-15-preview';
|
const apiVersion = '2023-03-15-preview';
|
||||||
|
|
||||||
const path = `openai/deployments/${model}/chat/completions?api-version=${apiVersion}`;
|
const path = `openai/deployments/${model}/chat/completions?api-version=${apiVersion}`;
|
||||||
|
|
Loading…
Reference in a new issue