SlidingWindowCompactionStrategy Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the SlidingWindowCompactionStrategy class.
public SlidingWindowCompactionStrategy(Microsoft.Agents.AI.Compaction.CompactionTrigger trigger, int minimumPreservedTurns = 1, Microsoft.Agents.AI.Compaction.CompactionTrigger? target = default);
new Microsoft.Agents.AI.Compaction.SlidingWindowCompactionStrategy : Microsoft.Agents.AI.Compaction.CompactionTrigger * int * Microsoft.Agents.AI.Compaction.CompactionTrigger -> Microsoft.Agents.AI.Compaction.SlidingWindowCompactionStrategy
Public Sub New (trigger As CompactionTrigger, Optional minimumPreservedTurns As Integer = 1, Optional target As CompactionTrigger = Nothing)
Parameters
- trigger
- CompactionTrigger
The CompactionTrigger that controls when compaction proceeds. Use TurnsExceed(Int32) for turn-based thresholds.
- minimumPreservedTurns
- Int32
The minimum number of most-recent turns (by TurnIndex) to preserve.
This is a hard floor — compaction will not exclude turns within this range, regardless of the target condition.
Groups with TurnIndex of 0 or null are always preserved.
- target
- CompactionTrigger
An optional target condition that controls when compaction stops. When null,
defaults to the inverse of the trigger — compaction stops as soon as the trigger would no longer fire.