Skip to content

Commit 16812f2

Browse files
committed
feat: interface add
Signed-off-by: potato <[email protected]>
1 parent 1256eaf commit 16812f2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spring-ai-model/src/main/java/org/springframework/ai/chat/memory/ChatMemoryRepository.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,15 @@ public interface ChatMemoryRepository {
4040

4141
void deleteByConversationId(String conversationId);
4242

43+
/**
44+
* Atomically removes the messages in {@code deletes} and adds the messages in {@code adds}
45+
* for the given conversation ID. This provides a more efficient way to update
46+
* the memory than reading the entire history and overwriting it.
47+
*
48+
* @param conversationId The ID of the conversation to update.
49+
* @param deletes A list of messages to be removed from the memory.
50+
* @param adds A list of new messages to be added to the memory.
51+
*/
52+
void refresh(String conversationId, List<Message> deletes, List<Message> adds);
53+
4354
}

0 commit comments

Comments
 (0)