Basic Streaming
Simply pass anAsyncIterable<string> to thread.post():
Platform Support
Slack
Native streaming via Assistants API - smooth character-by-character updates
Google Chat
Fallback mode - post + edit with throttling (500ms default)
Teams
Fallback mode - post + edit with throttling (500ms default)
Discord
Fallback mode - post + edit with throttling (500ms default)
How It Works
Native Streaming (Slack)
When the adapter supports native streaming:Fallback Streaming (Other Platforms)
For platforms without native support, the SDK uses post + edit:Streaming Markdown Renderer
The SDK includes a sophisticated streaming markdown renderer that handles:- Table buffering - Holds back potential table headers until confirmed by separator line
- Inline marker balancing - Prevents unclosed
**,*,~~,`,[from appearing mid-stream - Code fence tracking - Detects when inside code blocks to avoid processing markdown inside them
Table Buffering Example
Without buffering, tables would flash as raw pipe-delimited text:Inline Marker Balancing
Prevents broken formatting mid-stream:Configuration Options
Update Interval (Fallback Mode)
Control how often edits are sent:Placeholder Text
Customize the initial placeholder (or disable it):Streaming with Context
The SDK automatically extracts user/team context for Slack’s streaming API:Advanced: Streaming to Channels
When streaming to a channel (not a thread), the SDK accumulates text before posting:Channel-level streaming doesn’t support incremental updates - the full response is posted once complete.
Example: AI Chat Bot
Performance Considerations
Rate Limits
Slack Native Streaming
No additional rate limits - uses dedicated streaming API
Fallback Mode
Each edit counts against platform rate limits. Adjust
streamingUpdateIntervalMs if you hit limits.