Skip to content

HenryAllen04/ElevenLabs-Twilio-ConversationalAgentExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prank Call App

A fun application that uses ElevenLabs AI voice technology integrated with Twilio to trigger and automate conversational prank calls.

About

This app leverages the power of:

  • ElevenLabs Conversational Agent: An AI-driven voice chatbot capable of natural conversation
  • Twilio Voice API: Telephony infrastructure to place and manage calls

Using this integration, you can trigger automated calls where an AI agent conducts realistic conversations with the call recipient.

Prerequisites

  • Python 3.7+
  • ElevenLabs account with:
    • API key
    • Conversational Agent ID
    • Agent Phone Number ID (from ElevenLabs workspace)
  • Twilio account with:
    • Account SID
    • Auth Token
    • Twilio phone number

Installation

  1. Clone this repository
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Create a .env file in the project root with the following variables:
# ElevenLabs API credentials
ELEVENLABS_API_KEY=your_elevenlabs_api_key
ELEVENLABS_AGENT_ID=agent_01jvapqns3fpdtsz9vtyyvx458
ELEVENLABS_AGENT_PHONE_NUMBER_ID=your_agent_phone_number_id

# Twilio API credentials
TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_PHONE_NUMBER=your_twilio_phone_number

# Target phone number
TARGET_PHONE_NUMBER=+1234567890

How It Works

  1. The application uses the ElevenLabs API to trigger an outbound call through Twilio's infrastructure
  2. When the call is answered, the ElevenLabs Conversational Agent takes over
  3. The AI agent conducts a realistic conversation in real-time using advanced voice synthesis and natural language processing
  4. The conversation flow is handled entirely by the ElevenLabs Agent, which can understand responses and adapt accordingly

Usage

To trigger a call:

python launch_call.py

If successful, you'll see Success ✔️ Call initiated. along with the Twilio Call SID.

ElevenLabs Integration Setup

  1. Create a Conversational Agent in the ElevenLabs platform
  2. In your ElevenLabs workspace, set up Twilio integration:
    • Add your Twilio phone number
    • Set the Twilio webhook to https://api.<region>.elevenlabs.io/twilio/inbound_call
    • Create a workspace secret with your Twilio Auth Token
    • Copy the generated phone number ID to your .env file

Important Notes

  1. This is meant for entertainment purposes only. Use responsibly and ethically.
  2. Always comply with local laws regarding automated calls and recordings.
  3. The person being called should be aware this is for entertainment.
  4. Never use this for harassment, scams, or any malicious purposes.

Legal Considerations

Be aware of legal requirements in your jurisdiction regarding:

  • Automated calling systems
  • Call recording and consent
  • Impersonation laws
  • Spam and robocall regulations

About

EF x Anthropic Hackathon Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages