Class CoherenceChatMemoryStore.Builder

java.lang.Object
dev.langchain4j.store.memory.chat.coherence.CoherenceChatMemoryStore.Builder
Enclosing class:
CoherenceChatMemoryStore

public static class CoherenceChatMemoryStore.Builder extends Object
A builder to create CoherenceChatMemoryStore instances.
  • Constructor Details

  • Method Details

    • name

      Set the name of the NamedMap that will hold the serialized chat messages.
      Parameters:
      name - the name of the NamedMap to store serialized chat messages
      Returns:
      this builder for fluent method calls
    • session

      public CoherenceChatMemoryStore.Builder session(String sessionName)
      Set the name of the Session to use to obtain the document chunk NamedMap.
      Parameters:
      sessionName - the session name
      Returns:
      this builder for fluent method calls
    • session

      public CoherenceChatMemoryStore.Builder session(com.tangosol.net.Session session)
      Set the Session to use to obtain the document chunk NamedMap.
      Parameters:
      session - the Session to use
      Returns:
      this builder for fluent method calls
    • build

      public CoherenceChatMemoryStore build()
      Creates a new instance of CoherenceChatMemoryStore using the current configuration of this Builder.

      If a Session has not been explicitly set via the builder, this method will attempt to resolve it by sessionName using Coherence.getSession(String). If no sessionName is provided, the default session will be used via Coherence.getSession().

      Once a Session is resolved, the configured NamedMap (or the default CoherenceChatMemoryStore.DEFAULT_MAP_NAME if none was set) is retrieved and used to create a new CoherenceChatMemoryStore instance.

      Returns:
      a new instance of CoherenceChatMemoryStore