The primary objective of this project is to develop an interactive voice-controlled assistant leveraging OpenAI's GPT model to understand and respond to user queries in natural language. This assistant aims to enhance user interaction by providing a seamless and intuitive experience through speech recognition and text-to-speech conversion.
The project involves capturing audio commands from users, converting the speech to text, processing the text using the ChatGPT API, and converting the generated responses back into speech. The system is designed to handle natural language queries and provide meaningful responses, thereby improving the user experience.
- Conversational AI: Uses OpenAI's GPT-4 model for intelligent and contextual responses.
- Speech Recognition: Converts voice commands to text using the SpeechRecognition library.
- Text-to-Speech: Converts responses to voice output via pyttsx3.
- Web Integration: Opens websites like YouTube and Google based on voice commands.
-
Clone the repository:
git clone https://github.com/yourusername/yourrepository.git cd yourrepository
-
Install dependencies:
pip install openai SpeechRecognition pyttsx3
-
Add your OpenAI API key:
- Place your API key in a file named
apikey.py
:api_data = "your-api-key-here"
- Place your API key in a file named
-
Run the assistant:
python assistant.py
- Initiate Conversation: Run the script to start the assistant.
- Commands:
- Ask any question.
- Use commands like "Open YouTube" or "Open Google" for web-related tasks.
- Say "bye" to exit the assistant.
User: "Tell me about AI in simple terms."
Assistant: "AI, or Artificial Intelligence, is a branch of computer science focused on creating systems that can perform tasks requiring human intelligence, like understanding language or making decisions."