J.A.R.V.I.S is a voice-activated assistant built using Python. It uses several libraries to handle different functionalities such as speech recognition, text-to-speech, and web browsing. The assistant can perform tasks like searching on Google, fetching news, and defining words, among others.
- Voice Commands: Activate and control the assistant with your voice.
- Google Search: Perform Google searches using voice commands.
- News Updates: Fetch and read out the latest news headlines.
- Word Definitions: Get definitions of words using an online dictionary API.
- Customizable Websites: Open predefined websites with voice commands.
- Python 3.7 or higher
- Required libraries: transformers, torch, speech_recognition, gtts, pygame, webbrowser, requests
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Install the required libraries:
pip install transformers torch speechrecognition gtts pygame requests
-
Set up the News API key: Replace
your_news_api_key
in the code with your actual News API key.
-
Run the
jarvis.py
script:python jarvis.py
-
Upon running, the assistant initializes and waits for voice commands. Say "Jarvis" to activate it and then provide your command.
- The assistant uses the
speech_recognition
library to capture and interpret voice commands.
- The
gtts
(Google Text-to-Speech) library converts text responses into speech which is played back using thepygame
library.
- The
transformers
library with themicrosoft/DialoGPT-medium
model processes and generates responses for general queries.
- The
webbrowser
module is used to open predefined websites. - The
requests
module fetches news and dictionary definitions from online APIs.
You can add or modify the websites the assistant can open by editing the websites
dictionary in the dict.py
file.
- News API: Update the
News_api_link
variable with your API key. - Dictionary API: The assistant uses a free online dictionary API that does not require an API key.
- The voice recognition might not work perfectly in noisy environments.
- Some commands might not be processed correctly due to speech recognition inaccuracies.
- Fork the repository.
- 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 licensed under the MIT License - see the LICENSE file for details.
- Hugging Face for the
transformers
library and models. - Google Text-to-Speech for the TTS functionality.
- Pygame for the audio playback.
- SpeechRecognition library for capturing voice commands.
Feel free to contribute to this project by adding more features or improving the existing ones.