A Python-based virtual assistant using Gemini AI. This assistant is capable of voice recognition, text-to-speech, fetching weather updates, retrieving news, delivering jokes, pulling information from Wikipedia, and managing music. The project also includes an interactive web interface and is designed to be customizable and extendable.
- Voice Recognition: Processes and understands spoken commands.
- Text-to-Speech: Converts text responses into spoken output.
- Weather Information: Provides real-time weather updates.
- News Updates: Fetches the latest news headlines.
- Jokes: Delivers a variety of jokes.
- Wikipedia Information: Retrieves data from Wikipedia.
- Music Management: Handles and plays music.
- Web Interface: Interactive frontend with animations.
- Your Question: It Give Answer OF Your Questions.
A sophisticated Python-based virtual assistant utilizing Gemini AI. This project integrates various functionalities to create a versatile and interactive assistant.
Follow these steps to set up the project on your local machine:
-
Fork the Repository
- Click on the Fork button in the upper right corner of the page to create a copy of the repository under your GitHub account.
-
Clone the Repository
- Open your terminal or command prompt and run the following command to clone the repository to your local machine:
git clone https://github.com/suryanshsk/Python-Voice-Assistant-Suryanshsk.git
- Open your terminal or command prompt and run the following command to clone the repository to your local machine:
-
Navigate to the Project Directory
- Change your current directory to the project directory:
cd Python-Voice-Assistant-Suryanshsk
- Change your current directory to the project directory:
-
Set Up a Virtual Environment
- It is recommended to use a virtual environment to manage dependencies and avoid conflicts. Create and activate a virtual environment with the following commands:
python -m venv venv source venv/bin/activate # For Windows: venv\Scripts\activate
- It is recommended to use a virtual environment to manage dependencies and avoid conflicts. Create and activate a virtual environment with the following commands:
-
Install Dependencies
-
Install the required dependencies listed in the
requirements.txt
file:pip install -r requirements.txt
-
The
requirements.txt
file includes the following modules:speechrecognition==3.8.1 gtts==2.2.3 requests==2.28.1 beautifulsoup4==4.12.0 flask==2.3.2 websocket-client==1.5.1 google-generativeai==0.3.1 request speechrecognition pyttsx3 wikipedia requests pyjokes pyarrow==17.0.0 pyasn1==0.6.1 pyasn1_modules==0.4.1 PyAudio==0.2.14 pydeck==0.9.1 Pygments==2.18.0 pypiwin32==223 python-dateutil==2.9.0.post0 python-dotenv==1.0.1 pytz==2024.2 pywin32==307
-
Additionally, ensure you have the latest version of
google-generativeai
:pip install -U google-generativeai
-
To ensure your Python voice recognition assistant runs smoothly, here's a list of essential packages you should install:
pip install SpeechRecognition pip install pyaudio pip install setuptools
-
To use gTTS (Google Text-to-Speech) in your Python project:
pip install gtts
-
-
Configure API Keys
- Replace the placeholder API keys in the code with your actual API keys:
genai.configure(api_key="Your_Own_API_KEY_FOR_GEMINI_AI") # Replace with your actual API key api_key = 'YOUR_NEWS_API_KEY' # Replace with a real news API key API_KEY = 'YOUR_WEATHER_API_KEY' # Replace with your weather API key
- Replace the placeholder API keys in the code with your actual API keys:
-
Run the Application
- Start the virtual assistant by running the main script:
python main_assistant.py
- Start the virtual assistant by running the main script:
You are now ready to use the Python Voice Assistant with Gemini AI!
To use the Python Voice Assistant with Gemini AI, you need to configure your API keys. Replace the placeholder keys in the code with your actual API keys as shown below:
-
Gemini AI API Key:
genai.configure(api_key="GEMINI_API_KEY") # Replace with your actual API key
-
News API Key:
api_key = 'YOUR_NEWS_API_KEY' # Replace with a real news API key
-
Weather API Key:
API_KEY = 'YOUR_WEATHER_API_KEY' # Replace with your weather API key
Make sure to replace "GEMINI_API_KEY"
, 'YOUR_NEWS_API_KEY'
, and 'YOUR_WEATHER_API_KEY'
with your actual API keys to enable the respective functionalities.
We are grateful to all the contributors who have helped improve this project. Your contributions are what make this project better!
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
For questions or feedback, reach out to [email protected].
If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. We appreciate detailed and insightful reports that help us address the issue more effectively.