Class ChatMemoryService
java.lang.Object
dev.langchain4j.service.memory.ChatMemoryService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionChatMemoryService(ChatMemoryProvider chatMemoryProvider) ChatMemoryService(ChatMemory chatMemory) -
Method Summary
Modifier and TypeMethodDescriptionvoidclearAll()evictChatMemory(Object memoryId) getChatMemory(Object memoryId) getOrCreateChatMemory(Object memoryId) getOrCreateInvocationChatMemory(InvocationContext invocationContext) Returns the chat memory of the given invocation, wrapped so that every call to it (and so to itsChatMemoryStore) runs as work of that invocation: an AI Service invoked from there gets it as its parent invocation.static ChatMemoryunwrap(ChatMemory chatMemory) Returns the chat memory as configured by the user, without the wrapper added bygetOrCreateInvocationChatMemory(InvocationContext).
-
Field Details
-
DEFAULT
- See Also:
-
-
Constructor Details
-
ChatMemoryService
-
ChatMemoryService
-
-
Method Details
-
getOrCreateChatMemory
-
getOrCreateInvocationChatMemory
Returns the chat memory of the given invocation, wrapped so that every call to it (and so to itsChatMemoryStore) runs as work of that invocation: an AI Service invoked from there gets it as its parent invocation. TheChatMemoryProvideris called the same way. -
unwrap
Returns the chat memory as configured by the user, without the wrapper added bygetOrCreateInvocationChatMemory(InvocationContext). -
getChatMemory
-
evictChatMemory
-
clearAll
public void clearAll() -
getChatMemoryIDs
-
getChatMemories
-