compression

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL