Package com.tnsai.memory.strategy
Class SummaryStrategy.Builder
java.lang.Object
com.tnsai.memory.strategy.SummaryStrategy.Builder
- Enclosing class:
SummaryStrategy
Builder for SummaryStrategy.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()keepRecentMessages(int count) Number of recent messages to keep un-summarized.preserveSystemPrompt(boolean preserve) Whether to preserve system prompts.summarizer(LLMClient llm) Uses an LLM for summarization.Sets a custom summarization function.summaryPrefix(String prefix) Prefix to add before the summary.summaryTargetTokens(int tokens) Target token count for the summary.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
summarizer
Sets a custom summarization function. -
summarizer
Uses an LLM for summarization. -
summaryPrefix
Prefix to add before the summary. Default: "[Previous conversation summary]: " -
keepRecentMessages
Number of recent messages to keep un-summarized. Default: 4 -
summaryTargetTokens
Target token count for the summary. Default: 200 -
preserveSystemPrompt
Whether to preserve system prompts. Default: true -
build
-