mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 06:00:56 +02:00
fix(PluginsClient.js): fix ChatOpenAI Azure Config Issue (#812)
* fix(PluginsClient.js): fix issue with creating LLM when using Azure * chore(PluginsClient.js): omit azure logging * refactor(PluginsClient.js): simplify assignment of azure variable The code was simplified by directly assigning the value of `this.azure` to the `azure` variable using object destructuring. This makes the code cleaner and more concise.
This commit is contained in:
parent
b85f3bf91e
commit
ae5b7d3d53
1 changed files with 3 additions and 1 deletions
|
@ -150,6 +150,7 @@ Only respond with your conversational reply to the following User Message:
|
|||
}
|
||||
|
||||
createLLM(modelOptions, configOptions) {
|
||||
let azure = {};
|
||||
let credentials = { openAIApiKey: this.openAIApiKey };
|
||||
let configuration = {
|
||||
apiKey: this.openAIApiKey,
|
||||
|
@ -158,6 +159,7 @@ Only respond with your conversational reply to the following User Message:
|
|||
if (this.azure) {
|
||||
credentials = {};
|
||||
configuration = {};
|
||||
({ azure } = this);
|
||||
}
|
||||
|
||||
if (this.options.debug) {
|
||||
|
@ -165,7 +167,7 @@ Only respond with your conversational reply to the following User Message:
|
|||
console.debug(configOptions);
|
||||
}
|
||||
|
||||
return new ChatOpenAI({ credentials, configuration, ...modelOptions }, configOptions);
|
||||
return new ChatOpenAI({ credentials, configuration, ...azure, ...modelOptions }, configOptions);
|
||||
}
|
||||
|
||||
async initialize({ user, message, onAgentAction, onChainEnd, signal }) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue