stream

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package llmstream contains provider stream decoders and transport lifecycle helpers for the unified LLM event model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunningEvent

func RunningEvent(elapsed time.Duration) event.Event

RunningEvent is a heartbeat/progress signal for streams whose upstream model is alive but temporarily quiet.

func StartedEvent

func StartedEvent(source string) event.Event

StartedEvent reports that the local agent process has been spawned. It is emitted by adapters before provider stdout produces its first model delta.

Types

type Decoder

type Decoder interface {
	DecodeLine(line []byte) []event.Event
	Flush() []event.Event
}

Decoder converts provider-specific stream frames into unified LLM events. DecodeLine may return multiple events because one provider frame can contain several semantic blocks, such as text followed by a tool call.

func NewClaudeDecoder

func NewClaudeDecoder() Decoder

NewClaudeDecoder returns a stateful decoder for Claude Code --output-format stream-json output, including --include-partial-messages.

type DecoderFunc

type DecoderFunc func(line []byte) []event.Event

DecoderFunc adapts a stateless line parser to Decoder.

func (DecoderFunc) DecodeLine

func (f DecoderFunc) DecodeLine(line []byte) []event.Event

func (DecoderFunc) Flush

func (f DecoderFunc) Flush() []event.Event

Jump to

Keyboard shortcuts

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