Documentation
¶
Overview ¶
Package aggregator provides a processor that collects text frames and emits a single aggregated frame (e.g. sentence).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Processor ¶
type Processor struct {
*processors.BaseProcessor
// SentenceEnd marks end of sentence (e.g. ".!?").
SentenceEnd string
// MaxBuffer is the maximum rune count before flushing without a sentence end (0 = no limit).
MaxBuffer int
// contains filtered or unexported fields
}
Processor collects TextFrame (and LLMTextFrame) chunks and emits one TextFrame when a sentence boundary is seen or buffer exceeds max size.
func New ¶
New returns an aggregator processor. SentenceEnd defaults to ".!?"; MaxBuffer 0 means no limit.
func (*Processor) ProcessFrame ¶
func (p *Processor) ProcessFrame(ctx context.Context, f frames.Frame, dir processors.Direction) error
ProcessFrame accumulates text from TextFrame/LLMTextFrame and forwards other frames; emits aggregated TextFrame on sentence end or buffer limit.
Click to show internal directories.
Click to hide internal directories.