Module: Anthropic::Helpers::Tools::CompactionControl
- Defined in:
- lib/anthropic/helpers/tools/compaction_control.rb
Overview
Configuration for automatic conversation history compaction in tool runners.
When the cumulative token count (input + output) across all messages exceeds the threshold, the message history will be automatically summarized and compressed.
By default, a warning is printed to STDERR the first time compaction occurs for
each runner instance. To silence the warning, provide an on_compact callback -
when present, the warning is suppressed and you handle compaction events your way.
Instance Attribute Summary collapse
-
#context_token_threshold ⇒ Integer?
The cumulative token count threshold at which to trigger compaction.
-
#enabled ⇒ Boolean
Whether to enable automatic compaction.
-
#model ⇒ String, ...
The model to use for generating the compaction summary.
-
#on_compact ⇒ Proc?
Optional callback invoked when compaction occurs.
-
#summary_prompt ⇒ String?
The prompt used to instruct the model on how to generate the summary.
Instance Attribute Details
#context_token_threshold ⇒ Integer?
102 |
# File 'lib/anthropic/helpers/tools/compaction_control.rb', line 102 module CompactionControl; end |
#enabled ⇒ Boolean
102 |
# File 'lib/anthropic/helpers/tools/compaction_control.rb', line 102 module CompactionControl; end |
#model ⇒ String, ...
102 |
# File 'lib/anthropic/helpers/tools/compaction_control.rb', line 102 module CompactionControl; end |
#on_compact ⇒ Proc?
102 |
# File 'lib/anthropic/helpers/tools/compaction_control.rb', line 102 module CompactionControl; end |
#summary_prompt ⇒ String?
102 |
# File 'lib/anthropic/helpers/tools/compaction_control.rb', line 102 module CompactionControl; end |