Class CoherenceChatMemoryStore
java.lang.Object
dev.langchain4j.store.memory.chat.coherence.CoherenceChatMemoryStore
- All Implemented Interfaces:
ChatMemoryStore
A
ChatMemoryStore backed by an Oracle Coherence named map.
The CoherenceChatMemoryStore supports memory identifiers of any type
that is a valid Coherence NamedMap key. The key type must properly
implement equals() and hashCode() and be serializable by
the configured Coherence serializer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder to createCoherenceChatMemoryStoreinstances. -
Field Summary
FieldsModifier and TypeFieldDescriptionTheNamedMapused to store the chat messages.static final StringThe defaultNamedMapname. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCoherenceChatMemoryStore(com.tangosol.net.NamedMap<Object, String> chatMemory) Create aCoherenceChatMemoryStore. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Return aCoherenceChatMemoryStore.Builderto use to build aCoherenceChatMemoryStore.static CoherenceChatMemoryStorecreate()Create a defaultCoherenceChatMemoryStore.static CoherenceChatMemoryStoreCreate aCoherenceChatMemoryStorethat uses the specified CoherenceNamedMapname.static CoherenceChatMemoryStoreCreate aCoherenceChatMemoryStorethat uses the specified CoherenceNamedMapname.voiddeleteMessages(Object memoryId) getMessages(Object memoryId) voidupdateMessages(Object memoryId, List<ChatMessage> messages)
-
Field Details
-
DEFAULT_MAP_NAME
-
chatMemory
-
-
Constructor Details
-
CoherenceChatMemoryStore
Create aCoherenceChatMemoryStore.This method is protected, instances of
CoherenceChatMemoryStoreare created using the builder.- Parameters:
chatMemory- theNamedMapto store the chat history.
-
-
Method Details
-
getMessages
- Specified by:
getMessagesin interfaceChatMemoryStore
-
updateMessages
- Specified by:
updateMessagesin interfaceChatMemoryStore
-
deleteMessages
- Specified by:
deleteMessagesin interfaceChatMemoryStore
-
create
Create a defaultCoherenceChatMemoryStore.- Returns:
- a default
CoherenceChatMemoryStore
-
create
Create aCoherenceChatMemoryStorethat uses the specified CoherenceNamedMapname.- Parameters:
name- the name of the CoherenceNamedMapused to store chat messages- Returns:
- a
CoherenceChatMemoryStore
-
create
Create aCoherenceChatMemoryStorethat uses the specified CoherenceNamedMapname.- Parameters:
map- theNamedMapused to store chat messages- Returns:
- a
CoherenceChatMemoryStore
-
builder
Return aCoherenceChatMemoryStore.Builderto use to build aCoherenceChatMemoryStore.- Returns:
- a
CoherenceChatMemoryStore.Builderto use to build aCoherenceChatMemoryStore
-