Skip to main content
A streamed turn is a text/event-stream. The SDK turns each frame into a typed TurnEvent. The stream ends after a terminal event and [DONE]. For a shopping reply you usually need three events: save the conversation id, append text as it arrives, then take the finished message (including product cards). part_index is the position in the final message. Order inside one reply is stable. See messages and parts for what to render.
The stream sends a heartbeat about every 15 seconds — silence between tokens is not a dead connection. A turn that fails before it starts returns a normal HTTP error, not an error event. See errors.