A simple AI phone assistant that uses OpenAI's GPT-4 to handle phone conversations. Users can call a dedicated phone number to have natural conversations with an AI assistant.
- Phone-based AI conversation using OpenAI's GPT-4
- Natural voice interaction
- Conversation history tracking for context
- Simple web interface displaying the phone number
- Secure call handling with Twilio
- Python 3.8 or higher
- Twilio account with a phone number
- OpenAI API key
- Clone the repository:
git clone <repository-url>
cd <repository-name>- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Create a
.envfile:
cp .env.template .env- Update the
.envfile with your credentials:
FLASK_SECRET_KEY: Generate a secure random keyOPENAI_API_KEY: Your OpenAI API keyTWILIO_ACCOUNT_SID: Your Twilio account SIDTWILIO_AUTH_TOKEN: Your Twilio auth tokenTWILIO_PHONE_NUMBER: Your Twilio phone number (format: +1234567890)
- Start the Flask application:
python app.py- Access the web interface:
- Open your browser and go to
http://localhost:5000 - You'll see the phone number to call
- Make a call:
- Call the displayed phone number
- The AI assistant will answer and engage in conversation
- Speak naturally and the AI will respond
- The conversation will maintain context throughout the call
- When a user calls the Twilio phone number, the call is routed to the Flask application
- The application uses OpenAI's GPT-4 to process speech input and generate responses
- Conversation history is maintained during the call for context
- The AI responds using natural language, optimized for voice conversation
- The call continues until the user hangs up
- All API keys and credentials are stored in the
.envfile - The
.envfile should never be committed to version control - Calls are handled securely through Twilio's infrastructure
- Conversation history is maintained only during active calls
For issues or questions, please open an issue in the repository.