Documentation
¶
Overview ¶
Package patternaggregator provides XML-style tag aggregation for LLM text streams. It detects open/close delimiters (e.g. " ` " and " ` ") and emits matches with the inner content, plus non-tag text segments. Used by IVR to extract DTMF, mode, and status commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator consumes incremental text and emits text segments and delimiter matches.
func New ¶
func New(open, close string) *Aggregator
New creates an aggregator with the given open and close delimiter strings (e.g. " ` " and " ` ").
func (*Aggregator) Feed ¶
func (a *Aggregator) Feed(text string) (textSegments []string, matches []Match)
Feed appends text and returns any complete text segments (before a match) and matches (content between delimiters). Call Flush when the stream ends to get any remaining buffered text.
func (*Aggregator) Flush ¶
func (a *Aggregator) Flush() (remaining string)
Flush returns any remaining buffered text and clears the buffer.