This virtual assistant, named Hazel, is a Python-based program designed to perform a variety of tasks through voice commands. Utilizing libraries like pyttsx3 for text-to-speech, speech_recognition for voice recognition, and others like pywhatkit, yfinance, pyjokes, webbrowser, datetime, and wikipedia, Hazel can assist users with daily digital tasks.
Hazel can:
Open YouTube and Google Browser: Responds to voice commands to open YouTube and Google in a web browser.
Provide Date and Time Information: Tells the current date, time, and day of the week upon request.
Conduct Wikipedia Searches: Performs a Wikipedia search and reads out a summary of the search topic.
Internet Searches and YouTube Playback: Searches the internet and plays YouTube videos based on voice commands.
Tell Jokes: Uses pyjokes
to tell random jokes.
Provide Stock Prices: Fetches and announces stock prices for predefined companies.
Customized Responses: Responds to specific keywords like "okay" and expects follow-up "yes" or "no" responses.
Currently, Hazel has the following limitations:
Speech Recognition Sensitivity: May struggle with short or monosyllabic responses like "yes" or "no".
Error Handling: Basic error handling is present, but more robust handling for network failures and speech recognition errors is needed.
Improved Contextual Conversations: Implementing a more sophisticated context management system to handle complex dialogues.
Enhanced Speech Recognition: Refining the speech recognition process, especially for short responses.
Additional Functionalities: Integrating more features such as setting reminders, sending emails, or reading news headlines.
To run Hazel, your virtual assistant, you need to install the necessary Python libraries. You can do this using pip:
pip install pyttsx3 speech_recognition pywhatkit yfinance pyjokes webbrowser datetime wikipedia
python hazel_assistant.py
Once running, Hazel listens for your commands. Here are some example commands you can try:
"Open YouTube" "What day is today?" "Do a Wikipedia search for [topic]" "Tell me a joke"