Package dev.langchain4j.service.memory
Interface ChatMemoryAccess
public interface ChatMemoryAccess
Allow to access the
ChatMemory of any AI service extending it.-
Method Summary
Modifier and TypeMethodDescriptionbooleanevictChatMemory(Object memoryId) Evicts theChatMemorywith the given id.dev.langchain4j.memory.ChatMemorygetChatMemory(Object memoryId) Returns theChatMemorywith the given id for this AI service or null if such memory doesn't exist.
-
Method Details
-
getChatMemory
Returns theChatMemorywith the given id for this AI service or null if such memory doesn't exist.- Parameters:
memoryId- The id of the chat memory.- Returns:
- The
ChatMemorywith the given memoryId or null if such memory doesn't exist.
-
evictChatMemory
Evicts theChatMemorywith the given id.- Parameters:
memoryId- The id of the chat memory to be evicted.- Returns:
- true if
ChatMemorywith the given id existed, and it was successfully evicted, false otherwise.
-