Pipecat Pipelines
In deepeval, you can run a voice simulation against a Pipecat pipeline. The pipeline is yours and self-hosted, so the connector takes the URL its WebSocket transport is listening on, connects the way any other client would, plays the simulated user's audio into it, and captures the spoken reply along with how long it took to start.
In Code
Start your pipeline as you normally would, then pass its URL to a PipecatConnector:
from deepeval.voice import PipecatConnector, VoiceConfig
connector = PipecatConnector(url="ws://localhost:8765")
voice_config = VoiceConfig(
connector=connector,
...,
)There are ONE mandatory and THREE optional parameters when creating a PipecatConnector, alongside the shared connector settings:
url: A string specifying the WebSocket URL your pipeline is serving on.- [Optional]
headers: A dictionary of HTTP headers sent with the upgrade request, for a pipeline behind auth. Defaulted toNone. - [Optional]
agent_sample_rate: An integer specifying the rate audio is sent to your pipeline at. Must match theaudio_in_sample_rateyour pipeline runs with, since Pipecat doesn't resample what it's handed. Defaulted to16000, which is Pipecat's own default. - [Optional]
client_ready: A boolean which, ifTrue, sends an RTVIclient-readymessage once connected. Defaulted toTrue. - [Optional]
turn_detection: A string preset —"eager","balanced", or"patient"— controlling how long a pause has to last before your agent is considered finished speaking. Defaulted to"balanced".
The reply's sample rate is read from the frames your pipeline sends, so audio_out_sample_rate needs no configuring here.
Turn Detection and Transcripts
Pipecat's frame schema carries audio, not turn boundaries — what says a turn is over is an RTVI bot-stopped-speaking message, and only a pipeline running an RTVIProcessor sends one:
from pipecat.processors.frameworks.rtvi import RTVIProcessor
rtvi = RTVIProcessor()
pipeline = Pipeline([transport.input(), rtvi, ..., transport.output()])With RTVI in the pipeline, deepeval ends each turn on the signal instead of inferring it from silence, and takes your agent's own words from bot-transcription — so no transcription runs on turns where one arrives. Without it, turns end on silence and every turn is transcribed. Either way VoiceConfig resolves a speech-to-text model for the turns that need one, so it still needs to be configured, credentials included.
Some pipelines hold their greeting — or their audio input — until the client announces itself. client_ready sends that announcement on connect, and a pipeline with no RTVIProcessor ignores it.
Pipelines on Other Transports
A Pipecat pipeline served over WebRTC is reached through the connector for that service rather than this one: a pipeline on LiveKit is a LiveKit room, so LiveKitConnector joins it.
PipecatConnector also expects your transport's default serializer, which puts protobuf frames on the wire. Pipecat's other serializers exist to speak the audio dialects of telephony providers like Twilio and Plivo, so a pipeline using one is an agent taking a real phone call — which the simulator can't place. Run that same pipeline behind a plain WebSocket transport to test it.
For how connectors fit into the simulation loop, and for turn detection in full, see Voice Connectors.