Class TablestoreChatMemoryStore

java.lang.Object
dev.langchain4j.store.memory.chat.tablestore.TablestoreChatMemoryStore
All Implemented Interfaces:
ChatMemoryStore

public class TablestoreChatMemoryStore extends Object implements ChatMemoryStore
  • Constructor Details

    • TablestoreChatMemoryStore

      public TablestoreChatMemoryStore(com.alicloud.openservices.tablestore.SyncClient client)
    • TablestoreChatMemoryStore

      public TablestoreChatMemoryStore(com.alicloud.openservices.tablestore.SyncClient client, String tableName, String pkName1, String pkName2, String chatMessageFieldName)
  • Method Details

    • init

      public void init()
    • clear

      public void clear()
      Clear all message.
    • getMessages

      public List<ChatMessage> getMessages(Object memoryId)
      Description copied from interface: ChatMemoryStore
      Retrieves messages for a specified chat memory.
      Specified by:
      getMessages in interface ChatMemoryStore
      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

      public void updateMessages(Object memoryId, List<ChatMessage> messages)
      Description copied from interface: ChatMemoryStore
      Updates messages for a specified chat memory.
      Specified by:
      updateMessages in interface ChatMemoryStore
      Parameters:
      memoryId - 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.
    • deleteMessages

      public void deleteMessages(Object memoryId)
      Description copied from interface: ChatMemoryStore
      Deletes all messages for a specified chat memory.
      Specified by:
      deleteMessages in interface ChatMemoryStore
      Parameters:
      memoryId - The ID of the chat memory.