llmcontextsummarizer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package llmcontextsummarizer provides a processor that monitors LLM context size and emits LLMContextSummaryRequestFrame when thresholds are exceeded; applies results from LLMContextSummaryResultFrame.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxContextTokens        int
	MaxUnsummarizedMessages int
	MinMessagesToKeep       int
	TargetContextTokens     int
	SummarizationPrompt     string
	SummarizationTimeoutSec int
	AutoTrigger             bool
}

Config holds summarizer thresholds and options.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns default config values.

type Processor

type Processor struct {
	*processors.BaseProcessor
	Context *frames.LLMContext
	Config  Config
	// contains filtered or unexported fields
}

Processor monitors context and pushes summary requests; applies summary results.

func New

func New(name string, ctx *frames.LLMContext, cfg Config) *Processor

New returns a context summarizer. If cfg is zero value, DefaultConfig is used.

func (*Processor) ProcessFrame

func (p *Processor) ProcessFrame(ctx context.Context, f frames.Frame, dir processors.Direction) error

ProcessFrame checks thresholds on LLMFullResponseStartFrame; applies result on LLMContextSummaryResultFrame.

Jump to

Keyboard shortcuts

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