Expand description
Streaming primitives: the SSE decoder, a tolerant streaming-JSON parser,
the fine-grained AssistantMessageEvent protocol, and the
AssistantStream type that providers return.
Structs§
- Server
Sent Event - A raw Server-Sent Event decoded from the HTTP response body.
- SseDecoder
- Incremental line-buffered SSE decoder (mirrors pi’s
iterateSseMessages).
Enums§
- Assistant
Message Event - Fine-grained events emitted while streaming a model response. Mirrors
pi’s
AssistantMessageEvent.
Functions§
- channel_
stream - Build an
AssistantStreamfrom a channel pair. The provider pushes events through the sender from a spawned task. - parse_
streaming_ json - Parse possibly-truncated streaming JSON (e.g. tool-call
input_json_deltafragments). Mirrors pi’sparseStreamingJson: returns the best-effort parsed value, repairing truncated input so the agent always gets usable arguments to execute.
Type Aliases§
- Assistant
Stream - A boxed, pinned async stream of assistant events.