-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fixed message order for JDBC Chat Memory #2781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed message order for JDBC Chat Memory #2781
Conversation
@leijendary @sobychacko Can you please take a look? As far as I see you were main contributor/reviewer of that feature |
…r for batch inserts Signed-off-by: linarkou <[email protected]>
6cba78c
to
2b42f34
Compare
This is good! It is probably better to remove the default value for the |
Signed-off-by: linarkou <[email protected]>
…er' into chat-memory-jdbc-fix-message-order
✅ Thanks for the suggestion! I've updated the code. |
I just found out that Cassandra ChatMemory solves same problem in different, probably more efficient way:
What do you think, maybe we should implement same logic here? |
@linarkou thanks so much for this improvement! We have just delivered some changes to the The The "lastN" concept has been deprecated (so the DESC sorting is not needed anymore) in favour of strategy-specific Upgrade Notes: https://docs.spring.io/spring-ai/reference/upgrade-notes.html#_chat_memory |
# Conflicts: # auto-configurations/models/chat/memory/spring-ai-autoconfigure-model-chat-memory-jdbc/src/test/java/org/springframework/ai/model/chat/memory/jdbc/autoconfigure/JdbcChatMemoryDataSourceScriptDatabaseInitializerPostgresqlTests.java
* set timestamp manually to prevent saving equal timestamps while batch insert * return DESC order into get query (in `JdbcChatMemory`) Signed-off-by: Linar Abzaltdinov <[email protected]>
Signed-off-by: Linar Abzaltdinov <[email protected]>
Applied changes for JdbcChatMemoryRepository |
Look great, thank you! |
@linarkou Could you rebase and squash the commits on this PR please? |
@linarkou Rebased the PR and running the tests. Will be merging shortly. |
Squashed and merged the changes as a1db00a. |
@ilayaperumalg thank you! And sorry for being late, didn't have ability to update PR. |
This PR solves some problems with message ordering: