Class CoherenceChatMemoryStore.Builder
java.lang.Object
dev.langchain4j.store.memory.chat.coherence.CoherenceChatMemoryStore.Builder
- Enclosing class:
CoherenceChatMemoryStore
A builder to create
CoherenceChatMemoryStore
instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates a new instance ofCoherenceChatMemoryStore
using the current configuration of thisBuilder
.Set the name of theNamedMap
that will hold the serializedchat messages
.session
(com.tangosol.net.Session session) Set theSession
to use to obtain the document chunkNamedMap
.Set the name of theSession
to use to obtain the document chunkNamedMap
.
-
Constructor Details
-
Builder
protected Builder()Create aCoherenceChatMemoryStore.Builder
.
-
-
Method Details
-
name
Set the name of theNamedMap
that will hold the serializedchat messages
.- Parameters:
name
- the name of theNamedMap
to store serializedchat messages
- Returns:
- this builder for fluent method calls
-
session
Set the name of theSession
to use to obtain the document chunkNamedMap
.- Parameters:
sessionName
- the session name- Returns:
- this builder for fluent method calls
-
session
Set theSession
to use to obtain the document chunkNamedMap
.- Parameters:
session
- theSession
to use- Returns:
- this builder for fluent method calls
-
build
Creates a new instance ofCoherenceChatMemoryStore
using the current configuration of thisBuilder
.If a
Session
has not been explicitly set via the builder, this method will attempt to resolve it bysessionName
usingCoherence.getSession(String)
. If nosessionName
is provided, the default session will be used viaCoherence.getSession()
.Once a
Session
is resolved, the configuredNamedMap
(or the defaultCoherenceChatMemoryStore.DEFAULT_MAP_NAME
if none was set) is retrieved and used to create a newCoherenceChatMemoryStore
instance.- Returns:
- a new instance of
CoherenceChatMemoryStore
-