Class TablestoreChatMemoryStore
java.lang.Object
dev.langchain4j.store.memory.chat.tablestore.TablestoreChatMemoryStore
- All Implemented Interfaces:
ChatMemoryStore
-
Constructor Summary
ConstructorsConstructorDescriptionTablestoreChatMemoryStore(com.alicloud.openservices.tablestore.SyncClient client) TablestoreChatMemoryStore(com.alicloud.openservices.tablestore.SyncClient client, String tableName, String pkName1, String pkName2, String chatMessageFieldName) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all message.voiddeleteMessages(Object memoryId) Deletes all messages for a specified chat memory.getMessages(Object memoryId) Retrieves messages for a specified chat memory.voidinit()voidupdateMessages(Object memoryId, List<ChatMessage> messages) Updates messages for a specified chat memory.
-
Constructor Details
-
TablestoreChatMemoryStore
public TablestoreChatMemoryStore(com.alicloud.openservices.tablestore.SyncClient client) -
TablestoreChatMemoryStore
-
-
Method Details
-
init
public void init() -
clear
public void clear()Clear all message. -
getMessages
Description copied from interface:ChatMemoryStoreRetrieves messages for a specified chat memory.- Specified by:
getMessagesin 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:ChatMemoryStoreUpdates messages for a specified chat memory.- Specified by:
updateMessagesin 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:ChatMemoryStoreDeletes all messages for a specified chat memory.- Specified by:
deleteMessagesin interfaceChatMemoryStore- Parameters:
memoryId- The ID of the chat memory.
-