mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-12 02:52:36 +01:00
♻️ fix: Prevent Instructions from Removal when nearing Max Context (#5516)
* refactor: getMessagesWithinTokenLimit to accept params object * refactor: always include instructions in payload if provided * ci: remove obsolete test * refactor: update logoutUser to accept request object and handle session destruction * test: enhance getMessagesWithinTokenLimit tests for instruction handling
This commit is contained in:
parent
528ee62eb1
commit
4110209494
6 changed files with 185 additions and 83 deletions
|
|
@ -416,7 +416,7 @@ class AnthropicClient extends BaseClient {
|
|||
}
|
||||
|
||||
let { context: messagesInWindow, remainingContextTokens } =
|
||||
await this.getMessagesWithinTokenLimit(formattedMessages);
|
||||
await this.getMessagesWithinTokenLimit({ messages: formattedMessages });
|
||||
|
||||
const tokenCountMap = orderedMessages
|
||||
.slice(orderedMessages.length - messagesInWindow.length)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue