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
|
|
@ -6,6 +6,8 @@
|
|||
* @property {string} azureOpenAIApiVersion - The Azure OpenAI API version.
|
||||
*/
|
||||
|
||||
const { isEnabled } = require('../server/utils');
|
||||
|
||||
/**
|
||||
* Sanitizes the model name to be used in the URL by removing or replacing disallowed characters.
|
||||
* @param {string} modelName - The model name to be sanitized.
|
||||
|
|
@ -44,7 +46,7 @@ const genAzureChatCompletion = (
|
|||
) => {
|
||||
// Determine the deployment segment of the URL based on provided modelName or azureOpenAIApiDeploymentName
|
||||
let deploymentSegment;
|
||||
if (modelName) {
|
||||
if (isEnabled(process.env.AZURE_USE_MODEL_AS_DEPLOYMENT_NAME) && modelName) {
|
||||
const sanitizedModelName = sanitizeModelName(modelName);
|
||||
deploymentSegment = `${sanitizedModelName}`;
|
||||
} else if (azureOpenAIApiDeploymentName) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue