Text Streaming
Partial Responses
Receive text responses as they’re generated:Server Side
The agent automatically streams responses:- Partial messages - Sent as text is generated
- Final messages - Complete response when done
Audio Streaming
Continuous Streaming
Audio is streamed continuously:- Start stream -
client_audio_startmessage - Stream chunks -
client_audio_chunkmessages (continuous) - End stream -
client_audio_endmessage
Real-time Processing
- Low latency - Immediate processing
- Interim results - See transcription as user speaks
- Natural flow - No artificial delays
Best Practices
Text Streaming
- Update UI incrementally - Show partial responses
- Handle final messages - Replace partial with final
- Show loading state - Indicate when streaming
Audio Streaming
- Consistent sample rate - Use same rate throughout
- Proper encoding - Use PCM16 for best quality
- Handle errors - Manage network interruptions
Next Steps
- Protocol → - WebSocket protocol details
- Error Handling → - Error handling
- Voice → - Learn about voice streaming

