Package com.hw.langchain.memory.buffer
Class ConversationBufferMemory
java.lang.Object
com.hw.langchain.memory.chat.memory.BaseChatMemory
com.hw.langchain.memory.buffer.ConversationBufferMemory
- All Implemented Interfaces:
BaseMemory
- Direct Known Subclasses:
ConversationBufferLimitedMemory
Buffer for storing conversation memory.
- Author:
- HamaWhite
-
Field Summary
Fields inherited from class com.hw.langchain.memory.chat.memory.BaseChatMemory
chatMemory, inputKey, outputKey, returnMessages
-
Constructor Summary
ConstructorDescriptionConversationBufferMemory
(boolean returnMessages) ConversationBufferMemory
(boolean returnMessages, BaseChatMessageHistory messageHistory) -
Method Summary
Modifier and TypeMethodDescriptionbuffer()
String buffer of memory.protected List<BaseMessage>
loadMemoryVariables
(Map<String, Object> inputs) Return history buffer.Will always return list of memory variables.Methods inherited from class com.hw.langchain.memory.chat.memory.BaseChatMemory
clear, saveContext
-
Constructor Details
-
ConversationBufferMemory
public ConversationBufferMemory() -
ConversationBufferMemory
public ConversationBufferMemory(boolean returnMessages) -
ConversationBufferMemory
-
-
Method Details
-
buffer
String buffer of memory. -
getMemoryMessages
-
memoryVariables
Will always return list of memory variables. -
loadMemoryVariables
Return history buffer.
-