This project implements an AI-powered call center agent using OpenAI's GPT-3.5 and Whisper models. The agent can handle both text and voice inputs, provide responses using text-to-speech, and generate basic analytics reports.
- Asynchronous operation for improved performance
- Voice input processing using OpenAI's Whisper model
- Text-based conversation handling using GPT-3.5
- Wake word detection for initiating conversations
- Text-to-speech functionality for spoken responses
- Basic analytics and reporting
- Handling of common scenarios like order status checks and return policy inquiries
- Configurable AI parameters
Before you begin, ensure you have met the following requirements:
- Python 3.7 or higher
- An OpenAI API key
-
Clone this repository:
git clone https://github.com/yourusername/ai-call-center-agent.git cd ai-call-center-agent
-
Install the required packages:
pip install openai speech_recognition pyaudio wave gtts pygame python-dotenv aiohttp
-
Set up your OpenAI API key:
- Create a
.env
file in the project root - Add your OpenAI API key to the
.env
file:OPENAI_API_KEY=your-api-key-here
- Create a
Create a config.json
file in the project root with the following structure:
{
"wake_word": "hey agent",
"model": "gpt-3.5-turbo",
"language": "en",
"max_tokens": 150,
"temperature": 0.7
}
You can modify these parameters to customize the agent's behavior:
wake_word
: The phrase to activate the agent (default: "hey agent")model
: The GPT model to use for text processing (default: "gpt-3.5-turbo")language
: The language for text-to-speech output (default: "en" for English)max_tokens
: Maximum number of tokens in the AI's response (default: 150)temperature
: Controls the randomness of the AI's responses (default: 0.7)
To run the AI Call Center Agent:
- Navigate to the project directory
- Run the following command:
python main.py
- The agent will start and listen for the wake word "hey agent"
- Once the wake word is detected, speak your query
- The agent will process your query and respond verbally
To stop the agent, use the keyboard interrupt (Ctrl+C). The agent will generate a basic report before shutting down.
Here are some example interactions you can try with the AI Call Center Agent:
-
Checking order status:
- You: "Hey agent, what's the status of my order?"
- Agent: Provides information about a simulated order
-
Inquiring about return policy:
- You: "Hey agent, can you explain the return policy?"
- Agent: Explains the return policy
-
General inquiries:
- You: "Hey agent, how can I track my shipment?"
- Agent: Provides information on shipment tracking
If you encounter any issues:
- Ensure all dependencies are correctly installed
- Check that your OpenAI API key is correctly set in the
.env
file - Verify that your microphone is working and properly configured
- Check the console output for any error messages or logs
Contributions to this project are welcome. Please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License - see the LICENSE file for details.
This is a demonstration project and is not intended for production use without further development and security considerations.
If you have any questions or feedback, please open an issue in this repository.