public class InMemoryChatMemoryStore extends Object implements ChatMemoryStore
ChatMemoryStore that stores state of ChatMemory (chat messages) in-memory.
This storage mechanism is transient and does not persist data across application restarts.
| Constructor and Description |
|---|
InMemoryChatMemoryStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteMessages(Object memoryId)
Deletes all messages for a specified chat memory.
|
List<ChatMessage> |
getMessages(Object memoryId)
Retrieves messages for a specified chat memory.
|
void |
updateMessages(Object memoryId,
List<ChatMessage> messages)
Updates messages for a specified chat memory.
|
public List<ChatMessage> getMessages(Object memoryId)
ChatMemoryStoregetMessages in interface ChatMemoryStorememoryId - The ID of the chat memory.ChatMessageDeserializer.public void updateMessages(Object memoryId, List<ChatMessage> messages)
ChatMemoryStoreupdateMessages in interface ChatMemoryStorememoryId - The ID of the chat memory.messages - List of messages for the specified chat memory, that represent the current state of the ChatMemory.
Can be serialized to JSON using ChatMessageSerializer.public void deleteMessages(Object memoryId)
ChatMemoryStoredeleteMessages in interface ChatMemoryStorememoryId - The ID of the chat memory.Copyright © 2023. All rights reserved.