Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compressor ¶
type Compressor struct {
// contains filtered or unexported fields
}
Compressor keeps the newest whole turns that fit the budget and replaces everything older with one summary message. The budget covers system messages and the kept conversation; the summary is not counted, and a Summarizer receives the budget to size it.
Compress is incremental: feed it its previous output plus the new messages and only the newly dropped messages are summarized, together with the previous summary, instead of the whole history again.
func New ¶
func New(cfg Config) *Compressor
func (*Compressor) Compress ¶
func (c *Compressor) Compress(ctx context.Context, req contextkit.Request) (*contextkit.Result, error)
type Config ¶
type Config struct {
Budget contextkit.Budget
// Profile defaults to contextkit.ProfileFromEnv.
Profile contextkit.Profile
// MinRecent is the number of trailing messages always kept, even over
// budget; at least 1. The kept window then extends back to the start of
// its turn.
MinRecent int
MaxToolChars int
Summarizer contextkit.Summarizer
}
Click to show internal directories.
Click to hide internal directories.