This repository has been archived by the owner on Jan 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(redis): fix message retrieval and improve system message support (#…
…83) Because - [Bug 🐛] Previously, the retrieval process would fetch the earliest messages instead of the latest ones, which was a critical bug. - [Improvement 🧹] Furthermore, the meaning of `latest_k` in the commit has been updated. It now refers to the latest K conversation turns. In a chat history, each conversation turn consists of one participant speaking or sending a message, followed by responses from other participants. For example: ``` User: Question 1 Assistant: Response 1 User: Question 2 Assistant: Response 2 ``` With the previous implementation, if `latest_k` was set to 3, the retrieved conversation would be incomplete: ``` Assistant: Response 1 User: Question 2 Assistant: Response 2 ``` This issue prevented complete conversation turns from being retrieved. - [Improvement 🧹] Additionally, this commit introduces support for system messages, which are treated as a special type of message for the LLM. Regardless of the chat history's length, the option to include the system message in the retrieved messages is now available. This commit: - fix the critical bug that caused the retrieval of early messages instead of the latest ones - update `latest_k` to refer to conversation turns - add support for system messages to ensure they can always be included when needed
- Loading branch information
1 parent
578663e
commit 0c19492
Showing
2 changed files
with
109 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters