Empower Langchain agents to interact with the real world via phone calls
gpt-4
is required for this to work. gpt-3.5-turbo
or older models are not smart enough to parse JSON responses in Langchain agents reliably out-of-the-box.
To get started, clone the Vocode repo or copy the Langchain agent app directory.
.env.template
and fill in your API keys. You’ll need:TELEPHONY_SERVER_BASE_URL
environment variable with your ngrok base URL: don’t include https://
so should be something like:
OUTBOUND_CALLER_NUMBER
environment variable. Include +
and the area code, so for a US phone number, it would look something like.langchain_agent
directory.
docker-compose
virtualenv
TelephonyServer
:tools/contacts.py
main.py
main.py
. It uses the Langchain library to initialize an agent that can have a conversation.
main.py
instantiates the langchain agent and relevant tools. It sets an objective, initializes a Langchain agent, and runs the conversation.
tools/vocode.py
makes use of the OutboundCall
class to initiate a phone call
telephony_app.py
instantiates a TelephonyServer
object to manage the phone call initiated by OutboundCall