Package dev.langchain4j.memory.chat
Class MessageWindowChatMemory.Builder
java.lang.Object
dev.langchain4j.memory.chat.MessageWindowChatMemory.Builder
- Enclosing class:
MessageWindowChatMemory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
chatMemoryStore
(ChatMemoryStore store) maxMessages
(Integer maxMessages)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
id
- Parameters:
id
- The ID of theChatMemory
. If not provided, a "default" will be used.- Returns:
- builder
-
maxMessages
- Parameters:
maxMessages
- The maximum number of messages to retain. If there isn't enough space for a new message, the oldest one is evicted.- Returns:
- builder
-
chatMemoryStore
- Parameters:
store
- The chat memory store responsible for storing the chat memory state. If not provided, anInMemoryChatMemoryStore
will be used.- Returns:
- builder
-
build
-