CompactionConfig
Configuration for context window compaction. When the message history exceeds the context budget, the compaction strategy is applied to reduce the message list while preserving essential information.
Class Diagram
Section titled “Class Diagram”---
title: CompactionConfig
config:
look: handDrawn
theme: colorful
class:
hideEmptyMembersBox: true
---
classDiagram
class CompactionConfig {
+string strategy
+int32 budget
+dictionary options
}
Yaml Example
Section titled “Yaml Example”strategy: summarizebudget: 50000options: preserveSystemMessages: trueProperties
Section titled “Properties”| Name | Type | Description |
|---|---|---|
| strategy | string | The compaction strategy identifier. Built-in strategies include ‘summarize’. Can also be a path to a .prompty file used as the summarization prompt. |
| budget | int32 | Character budget for the compacted context. Overrides TurnOptions.contextBudget when set. |
| options | dictionary | Additional strategy-specific options |