Documentation
¶
Overview ¶
Package streamutil provides helper functions for consuming streamed text responses from agents, including delta mode, accumulated mode, and debounced streaming.
Index ¶
- func StreamText(stream core.StreamedResponse, opts StreamTextOptions) iter.Seq2[string, error]
- func StreamTextAccumulated(stream core.StreamedResponse) iter.Seq2[string, error]
- func StreamTextDebounced(stream core.StreamedResponse, debounce time.Duration) iter.Seq2[string, error]
- func StreamTextDelta(stream core.StreamedResponse) iter.Seq2[string, error]
- type StreamTextOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamText ¶
func StreamText(stream core.StreamedResponse, opts StreamTextOptions) iter.Seq2[string, error]
StreamText wraps a StreamedResponse to yield text according to options.
func StreamTextAccumulated ¶
StreamTextAccumulated is a convenience for accumulated mode streaming.
func StreamTextDebounced ¶
func StreamTextDebounced(stream core.StreamedResponse, debounce time.Duration) iter.Seq2[string, error]
StreamTextDebounced wraps streaming with debounce grouping.
func StreamTextDelta ¶
StreamTextDelta is a convenience for delta mode streaming.
Types ¶
type StreamTextOptions ¶
type StreamTextOptions struct {
Delta bool // if true, yield deltas; if false, yield accumulated text
Debounce time.Duration // group events within this window (0 = no debounce)
}
StreamTextOptions configures text streaming behavior.
Click to show internal directories.
Click to hide internal directories.