Skip to main content
Use this when you need to pass options like task grouping or stop blocks to the streaming API. For simple streaming without options, pass the async iterable directly to thread.post().

Constructor

Parameters

AsyncIterable<string | StreamChunk | StreamEvent>
required

Returns

StreamingPlan

Properties

symbol
required
Symbol identifying this as a postable object
"stream"
required
The kind of object - used by adapters to dispatch
AsyncIterable<string | StreamChunk | StreamEvent>
required

Methods

getFallbackText()

Get a fallback text representation for adapters that don’t support this object type. This should return a human-readable string representation.

Returns

string

getPostData()

Get the data to send to the adapter

Returns

StreamingPlanData

isSupported()

Check if the adapter supports this object type

Parameters

required

Returns

boolean

onPosted()

Called after successful posting to bind the object to the thread

Parameters