Streaming Protocols (Advanced)
π Planned
 Documentation Under Construction
This advanced page will explain the technical details of Vanna's streaming protocols, including Server-Sent Events (SSE), WebSockets, and polling fallback.
Planned Content
- β Overview of streaming in Vanna
- β Server-Sent Events (SSE) - recommended
- β WebSocket protocol - alternative
- β Polling - fallback for restricted environments
- β Component update protocol
- β Message format and schemas
- β Implementing custom streaming endpoints
- β Performance considerations
Want to contribute or suggest improvements? Open an issue on GitHub
Streaming Options
When complete, this will explain:
Server-Sent Events (SSE) - Recommended
- Simpler than WebSockets
- Works through most proxies/firewalls
- Automatic reconnection
- Good for one-way server β client streaming
Endpoint: POST /api/vanna/v2/chat_sse
Content-Type: text/event-streamWebSocket - Alternative
- Full bidirectional communication
- Lower latency
- More complex infrastructure
- May require special proxy configuration
Endpoint: WS /api/vanna/v2/chat_websocketPolling - Fallback
- Maximum compatibility
- Higher latency
- More server load
- Use only when SSE/WS unavailable
Endpoint: POST /api/vanna/v2/chat_pollComponent Updates
How components update during streaming:
- Agent starts execution β Send component with βloadingβ state
- Tool executes β Update component with progress
- Tool completes β Update component with final state
- Agent responds β Add text messages
Message Protocol
The page will document:
- Message types (text, component, tool_invocation)
- Component update payloads
- Error handling
- Completion signals