This Voice Assistant project leverages the power of the OpenAI GPT model, pyttsx3 for text-to-speech, speech_recognition for converting spoken language into text, and python-dotenv for managing environment variables. It's designed to provide an interactive and conversational AI experience, inspired by Jarvis from the Iron Man series.
- Dynamic Conversations: Utilizes
langchainandlangchain_openaifor complex and coherent chat capabilities. - Customizable Settings: Configure model, voice, volume, and more via command-line arguments or environment variables.
- Session Management: Supports dynamic session IDs for managing conversation history.
- Speech Recognition: Includes phrase time limit settings for improved responsiveness.
- Python 3.7+
- An OpenAI API key
Before you begin, ensure you have Python installed on your system. Then, clone this repository and navigate into the project directory.
- Clone the Repository
git clone https://github.com/meirm/jarvis
cd jarvis- Install Dependencies
pip install -r requirements.txtYour requirements.txt file should contain the following:
langchain
pyttsx3
speech_recognition
python-dotenv
If the speech_recognition package didn't install successfully, alternatively you can install the package directly from the source code by cloning the Git repository and running the setup.py script:
git clone https://github.com/Uberi/speech_recognition.git
cd speech_recognition
python setup.py install
- Environment Setup
Create a .env file in the root of your project directory. Add your OpenAI API key like so:
OPENAI_API_KEY=your_api_key_hereReplace your_api_key_here with your actual OpenAI API key.
Run the assistant using the following command:
python jarvis.pyList available options by calling --help
python jarvis --helpList available voices
python jarvis --list_voicesYou can customize the behavior of the assistant by providing command-line arguments. For example:
python jarvis.py --model gpt-3.5-turbo --voice com.apple.speech.synthesis.voice.RalphFor a full list of options, use the help command:
python jarvis.py --helpProject based on the original work of @ShaunLinTW https://github.com/ShaunLinTW/Voice_Assistant_Jarvis_Based_on_ChatGPT_API
Contributions are welcome! Please feel free to submit a pull request or open an issue if you have suggestions or improvements.
This project is open-sourced under the MIT License. See the LICENSE file for more details.