mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
feat: user_provided token for plugins, temp remove user_provided azure creds for Plugins until solution is made
This commit is contained in:
parent
5b30ab5d43
commit
5ad0ef331f
7 changed files with 29 additions and 18 deletions
|
|
@ -167,11 +167,16 @@ const ask = async ({ text, endpoint, endpointOption, parentMessageId = null, con
|
|||
...endpointOption
|
||||
};
|
||||
|
||||
if (process.env.PLUGINS_USE_AZURE === 'true') {
|
||||
let oaiApiKey = req.body?.token ?? process.env.OPENAI_API_KEY;
|
||||
if (process.env.PLUGINS_USE_AZURE) {
|
||||
clientOptions.azure = getAzureCredentials();
|
||||
oaiApiKey = clientOptions.azure.azureOpenAIApiKey;
|
||||
}
|
||||
|
||||
const oaiApiKey = req.body?.token ?? process.env.OPENAI_API_KEY;
|
||||
if (oaiApiKey && oaiApiKey.includes('azure') && !clientOptions.azure) {
|
||||
clientOptions.azure = JSON.parse(req.body?.token) ?? getAzureCredentials();
|
||||
oaiApiKey = clientOptions.azure.azureOpenAIApiKey;
|
||||
}
|
||||
const chatAgent = new PluginsClient(oaiApiKey, clientOptions);
|
||||
|
||||
const onAgentAction = (action) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue