Expand description
Message-level truncation: cap oversized text, thinking, and tool-result fields.
This layer shrinks individual messages without changing conversation shape.
Structs§
- Message
Truncation Config - Knobs for message-level truncation.
Nonedisables the corresponding budget. - Message
Truncation Result - Outcome of
truncate_message. - Truncation
Compressor - Brute-force Unicode truncation — keeps the longest prefix whose serialised
JSON form fits in
target_bytes.
Traits§
- Content
Compressor - Pluggable strategy for compressing a single content string.
Functions§
- truncate_
message - Compress content fields inside message blocks so the total serialised size
fits within the budget. Delegates to the configured
ContentCompressor.