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.
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.
Click to show internal directories.
Click to hide internal directories.