Class TokenCountTrigger
java.lang.Object
org.springframework.ai.session.compaction.TokenCountTrigger
- All Implemented Interfaces:
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:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic TokenCountTrigger.Builderbuilder()intbooleanshouldCompact(CompactionRequest request) Whether the view should be compacted now.
-
Method Details
-
shouldCompact
Description copied from interface:CompactionTriggerWhether the view should be compacted now.- Specified by:
shouldCompactin interfaceCompactionTrigger
-
getThreshold
public int getThreshold() -
builder
-