Integrate a real-time AI voice agent with Twilio
main.py
: Entrypoint filecerebrium.toml
: Build and environment configurationcerebrium.toml
:
main.py
:
templates
folder with stream.xml
inside. This XML response tells Twilio to upgrade to a WebSocket connection:
cerebrium.toml
:
bot.py
to set up the AI agent using PipeCat for component integration, interruption handling, and audio processing:
replica_concurrency
setting to spawn new containers based on utilization, preventing cold starts for subsequent calls.
To make the two updates above you can update your cerebrium.toml to contain the following: