Interface ChatMemory

All Known Implementing Classes:
MessageWindowChatMemory

public interface ChatMemory
The contract for storing and managing the memory of chat conversations.
Since:
1.0.0
Author:
Christian Tzolov, Thomas Vitale
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(String conversationId, List<Message> messages)
    Save the specified messages in the chat memory for the specified conversation.
    default void
    add(String conversationId, Message message)
    Save the specified message in the chat memory for the specified conversation.
    void
    clear(String conversationId)
    Clear the chat memory for the specified conversation.
    default List<Message>
    get(String conversationId)
    Get the messages in the chat memory for the specified conversation.
    get(String conversationId, int lastN)
    Deprecated.
    in favor of using MessageWindowChatMemory.
  • Field Details

  • Method Details

    • add

      default void add(String conversationId, Message message)
      Save the specified message in the chat memory for the specified conversation.
    • add

      void add(String conversationId, List<Message> messages)
      Save the specified messages in the chat memory for the specified conversation.
    • get

      default List<Message> get(String conversationId)
      Get the messages in the chat memory for the specified conversation.
    • get

      @Deprecated List<Message> get(String conversationId, int lastN)
      Deprecated.
      in favor of using MessageWindowChatMemory.
    • clear

      void clear(String conversationId)
      Clear the chat memory for the specified conversation.