Class InMemoryChatMemory
java.lang.Object
org.springframework.ai.chat.memory.InMemoryChatMemory
- All Implemented Interfaces:
ChatMemory
Deprecated.
The InMemoryChatMemory class is an implementation of the ChatMemory interface that
represents an in-memory storage for chat conversation history.
This class stores the conversation history in a ConcurrentHashMap, where the keys are
the conversation IDs and the values are lists of messages representing the conversation
history.
- Since:
- 1.0.0 M1
- Author:
- Christian Tzolov
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.ai.chat.memory.ChatMemory
DEFAULT_CONVERSATION_ID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.Save the specified messages in the chat memory for the specified conversation.void
Deprecated.Clear the chat memory for the specified conversation.Deprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.chat.memory.ChatMemory
add, get
-
Constructor Details
-
InMemoryChatMemory
public InMemoryChatMemory()Deprecated.
-
-
Method Details
-
add
Deprecated.Description copied from interface:ChatMemory
Save the specified messages in the chat memory for the specified conversation.- Specified by:
add
in interfaceChatMemory
-
get
Deprecated.- Specified by:
get
in interfaceChatMemory
-
clear
Deprecated.Description copied from interface:ChatMemory
Clear the chat memory for the specified conversation.- Specified by:
clear
in interfaceChatMemory
-
MessageWindowChatMemory
, which internally usesInMemoryChatMemoryRepository
.