Versions in this module Expand all Collapse all v0 v0.4.3 Nov 9, 2026 v0.4.2 Nov 4, 2026 Changes in this version + func EstimateTokens(msgs []llm.Message) int + func IsOverflow(err error) bool + type Compactor struct + func New(cfg Config, summarize Summarizer) *Compactor + func (c *Compactor) IsOverflow(err error) bool + func (c *Compactor) Pre(ctx context.Context, msgs []llm.Message, lastInputTokens int) []llm.Message + func (c *Compactor) Reactive(ctx context.Context, msgs []llm.Message) ([]llm.Message, bool) + type Config struct + ContextWindow int + KeepRecent int + MaxOutputTokens int + type Summarizer func(ctx context.Context, msgs []llm.Message) (string, error) + func ProviderSummarizer(p llm.Provider, maxOutputTokens int, nonStreaming bool) Summarizer