mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
This commit adds support for generating Azure OpenAI API endpoints in the `chatgpt-client.js` and `titleConvo.js` files. The `genAzureEndpoint` function in `genAzureEndpoints.js` generates the endpoint URL based on the provided parameters. The `chatgpt-client.js` and `titleConvo.js` files now use this function to generate the endpoint URL when the `AZURE_OPENAI_API_KEY` environment variable is set.
5 lines
327 B
JavaScript
5 lines
327 B
JavaScript
function genAzureEndpoint({ azureOpenAIApiInstanceName, azureOpenAIApiDeploymentName, azureOpenAIApiVersion }) {
|
|
return `https://${azureOpenAIApiInstanceName}.openai.azure.com/openai/deployments/${azureOpenAIApiDeploymentName}/chat/completions?api-version=${azureOpenAIApiVersion}`;
|
|
}
|
|
|
|
module.exports = { genAzureEndpoint };
|