Class RedisChatMemoryStore
java.lang.Object
dev.langchain4j.store.memory.chat.redis.RedisChatMemoryStore
- All Implemented Interfaces:
ChatMemoryStore
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionRedisChatMemoryStore
(String host, Integer port, String user, String password) -
Method Summary
Modifier and TypeMethodDescriptionstatic RedisChatMemoryStore.Builder
builder()
void
deleteMessages
(Object memoryId) Deletes all messages for a specified chat memory.getMessages
(Object memoryId) Retrieves messages for a specified chat memory.void
updateMessages
(Object memoryId, List<ChatMessage> messages) Updates messages for a specified chat memory.
-
Constructor Details
-
RedisChatMemoryStore
-
-
Method Details
-
getMessages
Description copied from interface:ChatMemoryStore
Retrieves messages for a specified chat memory.- Specified by:
getMessages
in interfaceChatMemoryStore
- Parameters:
memoryId
- The ID of the chat memory.- Returns:
- List of messages for the specified chat memory. Must not be null. Can be deserialized from JSON using
ChatMessageDeserializer
.
-
updateMessages
Description copied from interface:ChatMemoryStore
Updates messages for a specified chat memory.- Specified by:
updateMessages
in interfaceChatMemoryStore
- Parameters:
memoryId
- The ID of the chat memory.messages
- List of messages for the specified chat memory, that represent the current state of theChatMemory
. Can be serialized to JSON usingChatMessageSerializer
.
-
deleteMessages
Description copied from interface:ChatMemoryStore
Deletes all messages for a specified chat memory.- Specified by:
deleteMessages
in interfaceChatMemoryStore
- Parameters:
memoryId
- The ID of the chat memory.
-
builder
-