ai.stream.TurnStream$stream
The raw text-delta stream of ONE model turn. Pull-based: nothing is read from the wire until `next()` or `final_turn()` is called.
Reference version
Signature
class ai.stream.TurnStream$streamThe raw text-delta stream of ONE model turn. Pull-based: nothing is read
from the wire until next() or final_turn() is called.
next() yields DELTA chunks (each item is only the newly arrived text,
never the accumulated prefix) and returns Done when the turn is over.
final_turn() drains the rest of the stream and returns the completed
turn: the accumulated text as one Text block, the folded stop_reason, and
usage where the wire provided token counts.
Source:<builtin>/ai/ns_stream/stream.bamlbytes 0–0
Fields
_event_source
ai.stream.EventSource$stream | null_sse
baml.http.SseStream$stream | null_decode
unknown | null_chunks
string[]_cursor
int | null_pending
_pcursor
int | null_text
string | null_stop_reason
ai.content.StopReason | null_input_tokens
int | null_output_tokens
int | null_done
bool | null_require_terminal
string | null_saw_terminal
bool | null_calls
_wire_call
ai.events.LLMCall$stream | null_call_started
baml.time.Instant$stream | null_ttft_from
baml.time.Instant$stream | null_capture_sse
bool | null