mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🚤 refactor: Optimize Request Lifecycle Speeds (#3222)
* refactor: optimize backend operations for client requests * fix: message styling * refactor: Improve handleKeyUp logic in StreamRunManager.js and handleText.js * refactor: Improve handleKeyUp logic in StreamRunManager.js and handleText.js * fix: clear new convo messages on clear all convos * fix: forgot to pass userId to getConvo * refactor: update getPartialText to send basePayload.text
This commit is contained in:
parent
83619de158
commit
a2fd975cd5
17 changed files with 115 additions and 65 deletions
|
|
@ -238,7 +238,7 @@ class PluginsClient extends OpenAIClient {
|
|||
await this.recordTokenUsage(responseMessage);
|
||||
}
|
||||
|
||||
await this.saveMessageToDatabase(responseMessage, saveOptions, user);
|
||||
this.responsePromise = this.saveMessageToDatabase(responseMessage, saveOptions, user);
|
||||
delete responseMessage.tokenCount;
|
||||
return { ...responseMessage, ...result };
|
||||
}
|
||||
|
|
@ -303,7 +303,12 @@ class PluginsClient extends OpenAIClient {
|
|||
}
|
||||
|
||||
if (!this.skipSaveUserMessage) {
|
||||
await this.saveMessageToDatabase(userMessage, saveOptions, user);
|
||||
this.userMessagePromise = this.saveMessageToDatabase(userMessage, saveOptions, user);
|
||||
if (typeof opts?.getReqData === 'function') {
|
||||
opts.getReqData({
|
||||
userMessagePromise: this.userMessagePromise,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (isEnabled(process.env.CHECK_BALANCE)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue