llmfullresponse

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 llmfullresponse provides a processor that aggregates LLM text between LLMFullResponseStartFrame and LLMFullResponseEndFrame and invokes a callback on completion or interruption.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OnCompletion

type OnCompletion func(text string, completed bool)

OnCompletion is called when a full response ends (completed=true) or is interrupted (completed=false). Text is the aggregated content so far.

type Processor

type Processor struct {
	*processors.BaseProcessor
	OnCompletion OnCompletion
	// contains filtered or unexported fields
}

Processor aggregates LLMTextFrame between start/end frames and calls OnCompletion.

func New

func New(name string, onCompletion OnCompletion) *Processor

New returns an LLM full-response aggregator. onCompletion may be nil.

func (*Processor) ProcessFrame

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

ProcessFrame accumulates LLM text; forwards all frames; calls OnCompletion on end or interruption.

Jump to

Keyboard shortcuts

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