Documentation
¶
Overview ¶
Package sseutil provides shared utilities for SSE stream handling across LLM provider implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIdleTimeout = fmt.Errorf("stream idle timeout: no data received")
ErrIdleTimeout is returned when no data is received within the timeout.
Functions ¶
This section is empty.
Types ¶
type IdleTimeoutReader ¶
type IdleTimeoutReader struct {
// contains filtered or unexported fields
}
IdleTimeoutReader wraps an io.Reader and returns an error if no data is received within the timeout duration. The timer resets on every successful Read that returns data. This protects against stalled SSE streams where the connection stays open but stops sending events.
func NewIdleTimeoutReader ¶
func NewIdleTimeoutReader(r io.Reader, timeout time.Duration) *IdleTimeoutReader
NewIdleTimeoutReader creates a reader that errors after timeout of inactivity. A timeout of 0 disables the idle check (passes reads through directly).
Click to show internal directories.
Click to hide internal directories.