aggregator

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 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

func New(name string, sentenceEnd string, maxBuffer int) *Processor

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.

Jump to

Keyboard shortcuts

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