接口 ChatMemoryStore
- 所有已知实现类:
InMemoryChatMemoryStore
public interface ChatMemoryStore
Represents a store for the
Currently, the only implementation available is
More documentation can be found here.
ChatMemory state.
Allows for flexibility in terms of where and how chat memory is stored.
Currently, the only implementation available is
InMemoryChatMemoryStore.
Over time, out-of-the-box implementations will be added for popular stores like SQL databases, document stores, etc.
In the meantime, you can implement this interface to connect to any storage of your choice.
More documentation can be found here.
-
方法概要
修饰符和类型方法说明voiddeleteMessages(Object memoryId) Deletes all messages for a specified chat memory.getMessages(Object memoryId) Retrieves messages for a specified chat memory.voidupdateMessages(Object memoryId, List<ChatMessage> messages) Updates messages for a specified chat memory.
-
方法详细资料
-
getMessages
Retrieves messages for a specified chat memory.- 参数:
memoryId- The ID of the chat memory.- 返回:
- List of messages for the specified chat memory. Must not be null. Can be deserialized from JSON using
ChatMessageDeserializer.
-
updateMessages
Updates messages for a specified chat memory.- 参数:
memoryId- The ID of the chat memory.messages- List of messages for the specified chat memory, that represent the current state of theChatMemory. Can be serialized to JSON usingChatMessageSerializer.
-
deleteMessages
Deletes all messages for a specified chat memory.- 参数:
memoryId- The ID of the chat memory.
-