Class CoherenceChatMemoryStore
java.lang.Object
dev.langchain4j.store.memory.chat.coherence.CoherenceChatMemoryStore
- All Implemented Interfaces:
dev.langchain4j.store.memory.chat.ChatMemoryStore
public class CoherenceChatMemoryStore
extends Object
implements dev.langchain4j.store.memory.chat.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) List<dev.langchain4j.data.message.ChatMessage> getMessages(Object memoryId) voidupdateMessages(Object memoryId, List<dev.langchain4j.data.message.ChatMessage> messages)
-
Field Details
-
DEFAULT_MAP_NAME
The defaultNamedMapname.- See Also:
-
chatMemory
TheNamedMapused to store the chat messages.
-
-
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 interfacedev.langchain4j.store.memory.chat.ChatMemoryStore
-
updateMessages
public void updateMessages(Object memoryId, List<dev.langchain4j.data.message.ChatMessage> messages) - Specified by:
updateMessagesin interfacedev.langchain4j.store.memory.chat.ChatMemoryStore
-
deleteMessages
- Specified by:
deleteMessagesin interfacedev.langchain4j.store.memory.chat.ChatMemoryStore
-
create
Create a defaultCoherenceChatMemoryStore.- Returns:
- a default
CoherenceChatMemoryStore
-
create
Create aCoherenceChatMemoryStorethat uses the specified CoherenceNamedMapname.- Parameters:
name- the name of the CoherenceNamedMapused to store documents- Returns:
- a
CoherenceChatMemoryStore
-
create
Create aCoherenceChatMemoryStorethat uses the specified CoherenceNamedMapname.- Parameters:
map- theNamedMapused to store documents- Returns:
- a
CoherenceChatMemoryStore
-
builder
Return aCoherenceChatMemoryStore.Builderto use to build aCoherenceChatMemoryStore.- Returns:
- a
CoherenceChatMemoryStore.Builderto use to build aCoherenceChatMemoryStore
-