Create an Outbound AI agent that can transfer calls to real agents
outbound-trunk.json
using the Twilio phone number you purchased in the previous step, trunk domain name, and username
and password
.
lk sip outbound create outbound-trunk.json
The output of the command returns the trunk ID which we will need later.
pip install -r requirements.txt
. I will explain why we need FastAPI later.
Let us now get started on our code. Create a file called main.py where we will write the code for our agent. Your directory structure should look like this:
python main.py
in one terminal - this will keep the agents running as a open process and you should see the output as below.
python test.py
. This will initiate a call to the phone number you provided. Note,
you can’t make calls internationally but only to the region your number is purchased from.
With this now working locally, let us deploy it on Cerebrium to make it production ready with autoscaling capabilities.
cerebrium.toml
, edit the values with the following contents: