Skip to main content

Module streaming

Module streaming 

Source
Expand description

Streaming response channels for text, thought, and tool-call events. Streaming response bridge for the Antigravity SDK.

Bridges the SDK’s ChatResponse (Python async iterator) to tokio channels so Rust consumers can stream text tokens, thinking tokens, and tool call events independently.

Structs§

ChatResponseHandle
Handle to a streaming chat response.
ChatResponseWriter
The sending side of a ChatResponseHandle, held by the Python bridge thread that drives the SDK’s async iterator.
ChatResult
The result of draining a chat response via [ChatResponseHandle::text()].
StreamError
Error sent over the error channel when the Python stream fails.
ToolCallEvent
A tool call event received during streaming.
WriterError
Error returned when sending to a ChatResponseWriter channel fails.

Enums§

ResponseEvent
An ordered event from a response timeline, produced by [ChatResponseHandle::resolve].
StreamChunk
A chunk from the streaming response, combining text, thought, and tool call events.

Functions§

channel
Create a paired (ChatResponseWriter, ChatResponseHandle).