This project guides you through creating an AI assistant named Jarvis, inspired by Iron Man. The assistant listens for voice commands, processes them with a local language model, and responds using text-to-speech.
- Voice Activation: The assistant listens for the wake word "Jarvis" to initiate command processing.
- Speech Recognition: Converts spoken language into text using Google Speech Recognition.
- Natural Language Processing: Processes commands with a local instance of an OpenAI-compatible language model.
- Text-to-Speech: Responds to commands with spoken language using pyttsx3.
- Listening for Commands: The assistant continuously listens for the wake word "Jarvis" using the microphone.
- Speech Recognition: Upon detecting the wake word, the assistant uses Google Speech Recognition to convert the audio command into text.
- Processing Commands: The text command is sent to an OpenAI-compatible language model running locally, which interprets and generates a response.
- Responding: The response is converted back to speech and spoken out loud by the assistant.
To get started with this project, follow these steps:
-
Clone the Repository:
git clone https://github.com/MaanVader/Creating-an-AI-Assistant.git cd Creating-an-AI-Assistant
-
Install Dependencies:
pip install -r requirements.txt
-
Configure the Language Model:
- Ensure you have an OpenAI-compatible language model server running locally.
- Update the
interpreter.llm.api_base
injarvis2.py
to point to your local server. - Provide the necessary API key in
interpreter.llm.api_key
.
-
Run the Assistant:
python jarvis2.py
- Python 3.6+
- A working microphone
- SpeechRecognition
- Pyttsx3
- A local instance of an OpenAI-compatible language model
You can customize the assistant to recognize different wake words or commands by modifying the listen_for_jarvis
function. Additionally, you can integrate more sophisticated NLP models or external APIs for enhanced capabilities.
Contributions are welcome! Feel free to submit issues and pull requests to enhance the functionality and features of the AI assistant.
This project is licensed under the MIT License. See the LICENSE file for details.
Happy coding! Build your personal AI assistant today and bring Jarvis to life in your home or workspace.