Documentation
¶
Overview ¶
Package compression provides context-compression strategies for the React agent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compress ¶
func Compress( ctx context.Context, llm model.AgenticModel, messages []*schema.AgenticMessage, options common.CompressionOptions, opts ...model.Option, ) ([]*schema.AgenticMessage, int, int, int, error)
Compress applies the configured strategy to a React agent conversation. Model-based strategies use llm with tools disabled; discard_half does not use llm.
func ShouldCompress ¶
func ShouldCompress(messages []*schema.AgenticMessage, modelMaxTokensK int) bool
ShouldCompress reports whether the messages exceed the configured model context threshold. modelMaxTokensK is measured in thousands of tokens.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.