ai.clients.StreamRelay

Pulls one selected stream through a reliability policy. A typed, safely retryable failure may replace the selected stream only before the first text delta has been returned. Once any delta is visible, every later failure is terminal: replaying would duplicate a prefix and there is no resumable-stream contract at the client boundary.

Reference version

Signature

class ai.clients.StreamRelay

Pulls one selected stream through a reliability policy. A typed, safely retryable failure may replace the selected stream only before the first text delta has been returned. Once any delta is visible, every later failure is terminal: replaying would duplicate a prefix and there is no resumable-stream contract at the client boundary.

Source:<builtin>/ai/ns_clients/clients.bamlbytes 2099126292

Fields

emitted

bool

pending_text

string[]

pending_cursor

int

terminal_cursor

int

finished

bool

Instance methods

function

close_current

(self) -> void