Class ModelSummarizationStrategy
java.lang.Object
io.agentscope.spring.boot.admin.service.ModelSummarizationStrategy
- All Implemented Interfaces:
SummarizationStrategy
Default
SummarizationStrategy that asks the agent's own model to produce a fresh
rolling summary.
The strategy is intentionally conservative: it never includes the previous summary in the prompt verbatim (to avoid prompt explosion), only the existing summary plus the messages being folded. The model is instructed to keep names, dates, and any user-stated facts.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ModelSummarizationStrategy
public ModelSummarizationStrategy()
-
-
Method Details
-
summarize
public reactor.core.publisher.Mono<String> summarize(io.agentscope.core.model.Model model, String existingSummary, List<io.agentscope.core.message.Msg> messagesToFold) Description copied from interface:SummarizationStrategyProduce a new rolling summary.- Specified by:
summarizein interfaceSummarizationStrategy- Parameters:
model- the model to use (must not be null)existingSummary- the prior summary, or empty string when nonemessagesToFold- the messages currently in the agent context — typically everything except the lastkeepLastMessagesthat the caller will retain verbatim- Returns:
- the new summary text
-