SummarizationCompactionStrategy 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 SummarizationCompactionStrategy class.
public SummarizationCompactionStrategy(Microsoft.Extensions.AI.IChatClient chatClient, Microsoft.Agents.AI.Compaction.CompactionTrigger trigger, int minimumPreservedGroups = 8, string? summarizationPrompt = default, Microsoft.Agents.AI.Compaction.CompactionTrigger? target = default);
new Microsoft.Agents.AI.Compaction.SummarizationCompactionStrategy : Microsoft.Extensions.AI.IChatClient * Microsoft.Agents.AI.Compaction.CompactionTrigger * int * string * Microsoft.Agents.AI.Compaction.CompactionTrigger -> Microsoft.Agents.AI.Compaction.SummarizationCompactionStrategy
Public Sub New (chatClient As IChatClient, trigger As CompactionTrigger, Optional minimumPreservedGroups As Integer = 8, Optional summarizationPrompt As String = Nothing, Optional target As CompactionTrigger = Nothing)
Parameters
- chatClient
- IChatClient
The IChatClient to use for generating summaries. A smaller, faster model is recommended.
- 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 summarize groups beyond this limit, regardless of the target condition. Defaults to 8, preserving the current and recent exchanges.
- summarizationPrompt
- String
An optional custom system prompt for the summarization LLM call. When null,
DefaultSummarizationPrompt is used.
- 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.