Language

ToolResultCompactionStrategy Constructor

Definition

Initializes a new instance of the ToolResultCompactionStrategy class.

public ToolResultCompactionStrategy(Microsoft.Agents.AI.Compaction.CompactionTrigger trigger, int minimumPreservedGroups = 16, Microsoft.Agents.AI.Compaction.CompactionTrigger? target = default);
new Microsoft.Agents.AI.Compaction.ToolResultCompactionStrategy : Microsoft.Agents.AI.Compaction.CompactionTrigger * int * Microsoft.Agents.AI.Compaction.CompactionTrigger -> Microsoft.Agents.AI.Compaction.ToolResultCompactionStrategy
Public Sub New (trigger As CompactionTrigger, Optional minimumPreservedGroups As Integer = 16, Optional target As CompactionTrigger = Nothing)

Parameters

trigger
CompactionTrigger

The CompactionTrigger that controls when compaction proceeds.

minimumPreservedGroups
Int32

The minimum number of most-recent non-system message groups to preserve. This is a hard floor — compaction will not collapse groups beyond this limit, regardless of the target condition. Defaults to DefaultMinimumPreserved, ensuring the current turn's tool interactions remain visible.

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.

Applies to