mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 08:12:00 +02:00
🧠 fix: Prevent Memory Errors with Buffer String (#8196)
This commit is contained in:
parent
8ba61a86f4
commit
07e08143e4
1 changed files with 4 additions and 1 deletions
|
@ -525,7 +525,10 @@ class AgentClient extends BaseClient {
|
|||
messagesToProcess = [...messages.slice(-messageWindowSize)];
|
||||
}
|
||||
}
|
||||
return await this.processMemory(messagesToProcess);
|
||||
|
||||
const bufferString = getBufferString(messagesToProcess);
|
||||
const bufferMessage = new HumanMessage(`# Current Chat:\n\n${bufferString}`);
|
||||
return await this.processMemory([bufferMessage]);
|
||||
} catch (error) {
|
||||
logger.error('Memory Agent failed to process memory', error);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue