Documentation
¶
Overview ¶
Package stream provides streaming output for chat completions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Streamer)
Option configures a Streamer.
func WithContentStyle ¶
WithContentStyle sets the color style for content output.
func WithDefaultStyles ¶
func WithDefaultStyles() Option
WithDefaultStyles applies the default color scheme.
func WithPreamble ¶
WithPreamble sets text to display before streaming begins.
func WithPreambleStyle ¶
WithPreambleStyle sets the color style for the preamble.
func WithThinkingStyle ¶
WithThinkingStyle sets the color style for thinking output.
func WithVerbose ¶
WithVerbose controls whether thinking output is displayed.
type StreamResult ¶
type StreamResult struct {
Func Func
Stop func()
}
StreamResult holds the stream callback and cleanup function.
type Streamer ¶
type Streamer struct {
// Verbose controls whether thinking/reasoning output is displayed.
Verbose bool
// ThinkingStyle is the color style for thinking output.
ThinkingStyle *color.Color
// ContentStyle is the color style for content output.
ContentStyle *color.Color
// Preamble is text to display before streaming starts.
Preamble string
// PreambleStyle is the color style for the preamble.
PreambleStyle *color.Color
// Nil disables streaming entirely.
Nil bool
}
Streamer handles formatted streaming output with optional thinking display.
func (*Streamer) Stream ¶
func (s *Streamer) Stream(sp Spinner) StreamResult
Click to show internal directories.
Click to hide internal directories.