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
chatClientIChatClient-
The chat client used to generate the summary.
maxTokenCountint-
The nominal token budget before compaction is considered.
compactionThresholddouble-
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.