thread.post().
Handles these stream types automatically:
- Text streams (
AsyncIterable<string>, e.g. AI SDKtextStream) — passed through as-is. - AI SDK full streams (
AsyncIterable<object>, e.g.result.fullStream) — extractstext-deltaevents and injects"\n\n"separators after eachfinish-stepso that multi-step agent output reads naturally. - TanStack AI / AG-UI streams (
AsyncIterable<StreamChunk>fromchat()) — extractsTEXT_MESSAGE_CONTENTdeltas and injects"\n\n"separators after eachTEXT_MESSAGE_END, since every model turn in the tool loop is its own text message. - StreamChunk objects (
task_update,plan_update,markdown_text) — passed through as-is for adapters with native structured chunk support.
thread.post(), so you can pass any of these
streams directly:
Parameters
AsyncIterable<unknown>
required
Returns
StreamChunk