Pipecat
Pipecat provides a VoxEngine client for streaming audio to Pipecat Cloud and receiving turn-taking predictions.
Use Pipecat.createTurnDetector(...) to create a TurnDetector for the current scenario.
Related guides
Contents
- Usage: required module import and basic flow.
- Factory functions: create the Pipecat turn detector.
- Methods: reset, predict, and WebSocket lifecycle methods.
- TurnEvents: Pipecat turn detector event names and payload fields.
Usage
Add the module before using the namespace:
Create the detector, stream audio, and listen for turn prediction events.
Factory functions
createTurnDetector
Creates a Pipecat.TurnDetector instance.
Parameters
Returns
TurnDetector
Methods
addEventListener
Adds a handler for the specified Pipecat.TurnEvents event. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler is called.
Parameters
Returns
close
Closes the TurnDetector connection (over WebSocket) or connection attempt.
Parameters
This method does not accept parameters.
Returns
id
Returns the TurnDetector id.
Parameters
This method does not accept parameters.
Returns
predict
Triggers the TurnDetector to analyze the current audio and make a prediction. The result is returned in the Pipecat.TurnEvents.Result event.
Parameters
This method does not accept parameters.
Returns
removeEventListener
Removes a handler for the specified Pipecat.TurnEvents event.
Parameters
Returns
reset
Reset the TurnDetector context.
Parameters
This method does not accept parameters.
Returns
webSocketId
Returns the TurnDetector WebSocket id.
Parameters
This method does not accept parameters.
Returns
TurnEvents
These events describe Pipecat Cloud turn detector responses.