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 ofCoherenceChatMemoryStoreusing the current configuration of thisBuilder.Set the name of theNamedMapthat will hold the serializedchat messages.session(com.tangosol.net.Session session) Set theSessionto use to obtain the document chunkNamedMap.Set the name of theSessionto use to obtain the document chunkNamedMap.
-
Constructor Details
-
Builder
protected Builder()Create aCoherenceChatMemoryStore.Builder.
-
-
Method Details
-
name
Set the name of theNamedMapthat will hold the serializedchat messages.- Parameters:
name- the name of theNamedMapto store serializedchat messages- Returns:
- this builder for fluent method calls
-
session
Set the name of theSessionto use to obtain the document chunkNamedMap.- Parameters:
sessionName- the session name- Returns:
- this builder for fluent method calls
-
session
Set theSessionto use to obtain the document chunkNamedMap.- Parameters:
session- theSessionto use- Returns:
- this builder for fluent method calls
-
build
Creates a new instance ofCoherenceChatMemoryStoreusing the current configuration of thisBuilder.If a
Sessionhas not been explicitly set via the builder, this method will attempt to resolve it bysessionNameusingCoherence.getSession(String). If nosessionNameis provided, the default session will be used viaCoherence.getSession().Once a
Sessionis resolved, the configuredNamedMap(or the defaultCoherenceChatMemoryStore.DEFAULT_MAP_NAMEif none was set) is retrieved and used to create a newCoherenceChatMemoryStoreinstance.- Returns:
- a new instance of
CoherenceChatMemoryStore
-