Class TokenCountTrigger

java.lang.Object
org.springframework.ai.session.compaction.TokenCountTrigger
All Implemented Interfaces:
CompactionTrigger

public final class TokenCountTrigger extends Object implements CompactionTrigger
Fires when the estimated tokens of the view reach a threshold: the latest stored system message, the summaries and the conversation, measured on EventText with a TokenCountEstimator, JTokkit by default. A token budget uses the same measure, so the threshold and the budget are in the same units.
Since:
2.1.0
Author:
Christian Tzolov
See Also: