Table of Contents

Constructor SummarizingChatReducer

Namespace
Oscova.Agents.Reducers
Assembly
Oscova.Agents.dll

SummarizingChatReducer(IChatClient, int, double)

Compacts conversation history by stripping older tool chatter and summarizing older turns.

public SummarizingChatReducer(IChatClient chatClient, int maxTokenCount = 8192, double compactionThreshold = 0.8)

Parameters

chatClient IChatClient

The chat client used to generate the summary.

maxTokenCount int

The nominal token budget before compaction is considered.

compactionThreshold double

The fraction of the token budget that triggers summarization.

Remarks

Custom reducer kept instead of Microsoft.Extensions.AI's experimental SummarizingChatReducer: that reducer triggers on message count only; this one budgets by tokens derived from the model's context window, exposes the pre-compaction flush hook, and renders a user-editable Scriban summarization prompt.