mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🧹 Clean Up OpenAI Config and Show 'Set Azure Key' for Plugins (#1649)
* refactor(gptPlugins): prevent edge case where exact word `azure` could be found in azure api Key detection when not an azure key * refactor(SetKeyDialog): cleanup OpenAI config, show \'set azure key\' when `PLUGINS_USE_AZURE` env var is enabled
This commit is contained in:
parent
fcbaa74e4a
commit
0edfa0483e
3 changed files with 14 additions and 29 deletions
|
|
@ -60,7 +60,7 @@ const initializeClient = async ({ req, res, endpointOption }) => {
|
|||
|
||||
let apiKey = isUserProvided ? userKey : credentials[endpoint];
|
||||
|
||||
if (useAzure || (apiKey && apiKey.includes('azure') && !clientOptions.azure)) {
|
||||
if (useAzure || (apiKey && apiKey.includes('{"azure') && !clientOptions.azure)) {
|
||||
clientOptions.azure = isUserProvided ? JSON.parse(userKey) : getAzureCredentials();
|
||||
apiKey = clientOptions.azure.azureOpenAIApiKey;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue