mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
feat(azureOpenAI): Allow Switching Deployment Name by Model Name (#1137)
* feat(azureOpenAI): allow switching deployment name by model name * ci: add unit tests and throw error on no api key provided to avoid API call * fix(gptPlugins/initializeClient): check if azure is enabled; ci: add unit tests for gptPlugins/initializeClient * fix(ci): fix expected error message for partial regex match: unexpected token
This commit is contained in:
parent
a7b5639da1
commit
0886441461
8 changed files with 562 additions and 38 deletions
|
|
@ -16,6 +16,7 @@ const fetchOpenAIModels = async (opts = { azure: false, plugins: false }, _model
|
|||
let models = _models.slice() ?? [];
|
||||
let apiKey = openAIApiKey;
|
||||
let basePath = 'https://api.openai.com/v1';
|
||||
let reverseProxyUrl = OPENAI_REVERSE_PROXY;
|
||||
if (opts.azure) {
|
||||
return models;
|
||||
// const azure = getAzureCredentials();
|
||||
|
|
@ -23,11 +24,7 @@ const fetchOpenAIModels = async (opts = { azure: false, plugins: false }, _model
|
|||
// .split('/deployments')[0]
|
||||
// .concat(`/models?api-version=${azure.azureOpenAIApiVersion}`);
|
||||
// apiKey = azureOpenAIApiKey;
|
||||
}
|
||||
|
||||
let reverseProxyUrl = OPENAI_REVERSE_PROXY;
|
||||
|
||||
if (OPENROUTER_API_KEY) {
|
||||
} else if (OPENROUTER_API_KEY) {
|
||||
reverseProxyUrl = 'https://openrouter.ai/api/v1';
|
||||
apiKey = OPENROUTER_API_KEY;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue