JARVIS is a Python virtual assistant program based on the JARVIS system from Iron Man. It is designed to convert speech to text and text to speech using the ChatGPT model from OpenAI.
- Converts speech to text using the
speech_recognition
library. - Generates responses using OpenAI's ChatGPT.
- Converts the generated text to speech using the
pyttsx3
library.
Before you begin, ensure you have met the following requirements:
- You have Python 3 installed on your machine.
- You have an OpenAI API key. You can obtain it from OpenAI.
-
Clone the repository:
git clone https://github.com/thomascaneday/JARVIS.git
-
Navigate to the project directory:
cd jarvis
-
Install the required Python packages:
pip install speechrecognition pyttsx3 openai
-
Set your OpenAI API key in the
OPENAI_KEY
variable in the script:OPENAI_KEY = "YOUR_OPEN_AI_KEY"
-
Run the program:
python JARVIS.py
-
Speak into your microphone when prompted. JARVIS will recognize your speech, send it to ChatGPT, and read out the response.
SpeakText(command)
: Converts text to speech using thepyttsx3
library.record_text()
: Records audio from the microphone, converts it to text using Google’s speech recognition.send_to_chatGPT(messages, model="gpt-3.5-turbo")
: Sends the recorded text to ChatGPT and receives a response.- The main loop records the user's speech, sends it to ChatGPT, and speaks out the response.
- If the program is not connecting to OpenAI, ensure you are logged in and the API key is correct.
- For issues with the microphone, check your audio settings and ensure the microphone is properly connected.
- Fork the project.
- Create your feature branch:
git checkout -b feature/YourFeature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/YourFeature
- Open a pull request.
This project is open-source and available under the MIT License.
- OpenAI for providing the ChatGPT API.
- SpeechRecognition for speech recognition.
- pyttsx3 for text-to-speech conversion.