mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 17:30:16 +01:00
fix: Fixing bearer token attachment that broke in last merge conflict
This commit is contained in:
parent
6ba2d8e967
commit
c55df1e39a
2 changed files with 11 additions and 2 deletions
|
|
@ -101,7 +101,16 @@ const initializeClient = async ({
|
|||
clientOptions.dropParams = azureConfig.groupMap[groupName].dropParams;
|
||||
clientOptions.forcePrompt = azureConfig.groupMap[groupName].forcePrompt;
|
||||
|
||||
apiKey = azureOptions.azureOpenAIApiKey;
|
||||
if (shouldUseEntraId()) {
|
||||
apiKey = 'entra-id-placeholder';
|
||||
clientOptions.headers = {
|
||||
...clientOptions.headers,
|
||||
Authorization: `Bearer ${await getEntraIdAccessToken()}`,
|
||||
};
|
||||
} else {
|
||||
apiKey = azureOptions.azureOpenAIApiKey;
|
||||
}
|
||||
|
||||
clientOptions.azure = !serverless && azureOptions;
|
||||
if (serverless === true) {
|
||||
clientOptions.defaultQuery = azureOptions.azureOpenAIApiVersion
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ export const initializeOpenAI = async ({
|
|||
clientOptions.dropParams = groupMap[groupName]?.dropParams;
|
||||
}
|
||||
|
||||
apiKey = azureOptions.azureOpenAIApiKey;
|
||||
apiKey = shouldUseEntraId() ? 'entra-id-placeholder' : azureOptions.azureOpenAIApiKey;
|
||||
clientOptions.azure = !serverless ? azureOptions : undefined;
|
||||
|
||||
if (serverless === true) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue