Skip to content

PipecatAgentAdapter

Drives a custom Pipecat bot. Connects to your bot's WebSocket endpoint (which speaks the Twilio Media Streams binary protocol) or to a WebRTC signaling endpoint.

Constructor

python
import scenario
 
adapter = scenario.PipecatAgentAdapter(
    url="ws://localhost:8765/stream",
    audio_format="mulaw",
    sample_rate=8000,
)

Other arguments: signalingUrl / signaling_url (for transport: "webrtc"), transport ("websocket" default or "webrtc"), streamSid / stream_sid, callSid / call_sid.

Capabilities

streaming_transcriptsnative_vaddtmfinterruptioninput_formatsoutput_formats
pcm16/24000, mulaw/8000pcm16/24000, mulaw/8000

Worked examples

  • Python: pipecat_ws.py — full Pipecat WebSocket test with multi-turn conversation and a judge step; pipecat_scenario.py — multi-scenario Pipecat example.
  • TypeScript: pipecat-ws.test.ts — Pipecat WebSocket happy path over the Twilio Media Streams protocol.