mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
feat(OpenAIClient): AZURE_USE_MODEL_AS_DEPLOYMENT_NAME, AZURE_OPENAI_DEFAULT_MODEL (#1165)
* feat(OpenAIClient): AZURE_USE_MODEL_AS_DEPLOYMENT_NAME, AZURE_OPENAI_DEFAULT_MODEL * ci: fix initializeClient test
This commit is contained in:
parent
9d100ec0fc
commit
d5259e1525
10 changed files with 242 additions and 60 deletions
|
|
@ -1,6 +1,6 @@
|
|||
const { PluginsClient } = require('../../../../app');
|
||||
const { isEnabled } = require('../../../utils');
|
||||
const { getAzureCredentials, sanitizeModelName } = require('../../../../utils');
|
||||
const { getAzureCredentials } = require('../../../../utils');
|
||||
const { getUserKey, checkUserKeyExpiry } = require('../../../services/UserService');
|
||||
|
||||
const initializeClient = async ({ req, res, endpointOption }) => {
|
||||
|
|
@ -47,9 +47,6 @@ const initializeClient = async ({ req, res, endpointOption }) => {
|
|||
|
||||
if (useAzure || (apiKey && apiKey.includes('azure') && !clientOptions.azure)) {
|
||||
clientOptions.azure = isUserProvided ? JSON.parse(userKey) : getAzureCredentials();
|
||||
clientOptions.azure.azureOpenAIApiDeploymentName = sanitizeModelName(
|
||||
clientOptions.modelOptions.model,
|
||||
);
|
||||
apiKey = clientOptions.azure.azureOpenAIApiKey;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue