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:

  • 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-stream

WebSocket - Alternative

  • Full bidirectional communication
  • Lower latency
  • More complex infrastructure
  • May require special proxy configuration
Endpoint: WS /api/vanna/v2/chat_websocket

Polling - Fallback

  • Maximum compatibility
  • Higher latency
  • More server load
  • Use only when SSE/WS unavailable
Endpoint: POST /api/vanna/v2/chat_poll

Component Updates

How components update during streaming:

  1. Agent starts execution β†’ Send component with β€œloading” state
  2. Tool executes β†’ Update component with progress
  3. Tool completes β†’ Update component with final state
  4. Agent responds β†’ Add text messages

Message Protocol

The page will document:

  • Message types (text, component, tool_invocation)
  • Component update payloads
  • Error handling
  • Completion signals