Subscribing to events
Callbacks
Event listeners
Event reference
Session and connectivity
These events track the connection state of the client and bot. See Session Lifecycle for the full state progression.Voice activity
These events are driven by the bot’s VAD (voice activity detection) model. VAD is smarter than tracking raw audio levels — it understands turn-taking, so it can distinguish between a user who has finished speaking and one who has simply paused or is speaking slowly.Transcription and bot output
UserTranscript fires continuously as speech is recognized. Check data.final to distinguish committed transcripts from work-in-progress partials:
BotOutput is the recommended way to display the bot’s response text. It provides the best possible representation of what the bot is saying — supporting interruptions and unspoken responses. By default, Pipecat aggregates output by sentences and words (assuming your TTS supports streaming), but custom aggregation strategies are supported too - like breaking out code snippets or other structured content:
Errors
Always handle
Error. If data.fatal is true, the bot has already disconnected — update your UI accordingly:
Devices and tracks
Function calling
Other
For custom server<->client messaging, see Custom Messaging.