
Overview
Pipecat is an open-source Python framework for realtime voice agents. Cartesia is available as a first-party provider plugin for TTS and STT services in the Pipecat repo.Prerequisites
Pipecat’s examples require a recent Python installation (see the Pipecat repo’s root-level README for current prerequisites). Install thepipecat-ai Python package with the cartesia extra for TTS/STT (bracket syntax):
Getting Started
Integrating Cartesia is as simple as importing Cartesia services and plugging them into your agent:CartesiaTurnsSTTService requires pipecat-ai[cartesia]>=1.3.0.We strongly recommend it over the older
CartesiaSTTService for improved turn detection.Basic Example
Check out /examples/voice/voice-cartesia-turns.py in thepipecat-ai/pipecat repo for a fully working voice agent.
Advanced Example
You can take advantage of Ink’sturn.eager_end events to start generating an agent response slightly earlier than normal.
This can cut around half a second off your latency, making your agent more human-like.
Speculative User Aggregator
How to use
on_turn_eager_end from CartesiaTurnsSTTService