v0.8.4

Stream Symbols

Last updated

Stream event types, stream errors, SSE helpers, and read-cap constants.

Symbols

Symbol Signature / contents
StreamEvent Type, TextDelta, ReasoningDelta, ToolCall, Usage, FinishReason, Err
StreamEventType text / reasoning / tool_call / usage / done / error
ToolCallDelta Index, ID, Name, Arguments, ThoughtSignature
StreamError Provider, Code, Body, Err; implements Error() and Unwrap()
ErrStreamUnsupported error
OpenStream func(ctx, client *http.Client, url string, headers map[string]string, body map[string]any, label string) (*http.Response, error)
StreamChat / StreamResponses func(resp *http.Response, label string) <-chan StreamEvent
ResponsesStreamError func(label, data string) error
ScanSSE func(reader *bufio.Reader, handle func(event, data string) bool) error
TruncateFrame func(data string) string
Read caps StreamBodyLimit 64 MiB, ErrorBodyLimit 8 KiB, ErrorFrameLimit 512 B, JSONBodyLimit 64 KiB
中文