This is a Python-based Voice Assistant that leverages the power of the GoogleBard API for natural language processing and understanding user queries. The assistant can perform a variety of tasks, such as searching on Wikipedia, opening YouTube, opening Google, playing music, sending WhatsApp messages, and more.
Before running the Voice Assistant, ensure you have the required libraries installed. Use the following commands to install the dependencies:
pip install pyttsx3
pip install speech_recognition
pip install wikipedia
pip install pywhatkit
pip install webbrowser
pip install pyaudio
Additionally, you need to have GoogleBard installed:
pip install GoogleBard
pip install bardapi
To get the API key for GoogleBard, follow these steps:
- Install the necessary libraries as mentioned above.
- Go to your Bard chat and open developer options.
- Navigate to Application > Storage > Cookies > https://googlebard.com.
- Click on the
__Secure-1PSID
cookie to find your API key.
Once you have the API key, you can use it to make queries to the GoogleBard API.
The Voice Assistant comes with the following features:
-
Greeting: The assistant will greet you based on the current time of the day (morning, afternoon, or evening).
-
Wikipedia Search: You can ask the assistant to search for information on Wikipedia. Just say "Wikipedia" followed by your query.
-
Opening Google: You can ask the assistant to open Google and search for specific queries.
-
Opening YouTube: Ask the assistant to open YouTube and play your desired song.
-
Playing Music: The assistant can play random songs from a local music directory.
-
Opening Visual Studio Code: The assistant can open Visual Studio Code for you.
-
Sending WhatsApp Messages: The assistant can send WhatsApp messages to your contacts. Make sure to define contacts and their numbers in the code.
-
Asking Bard: The assistant can answer general queries using the GoogleBard API.
- Run the script and allow the assistant to access your microphone.
- The assistant will greet you and wait for your command.
- Give your command using natural language.
While this Voice Assistant is functional, it has some limitations and areas for improvement:
-
Dependency on Internet Connection: As the assistant uses online services like GoogleBard and PyWhatKit, it requires an active internet connection. If the connection is slow or unavailable, the assistant's performance may be affected.
-
Limited Voice Recognition Accuracy: The accuracy of voice recognition depends on the quality of the user's speech and background noise. In some cases, the assistant may misinterpret commands.
-
Security Concerns: The assistant's usage of external APIs may raise privacy and security concerns. Ensure that you trust the APIs and the data they process.
-
Lack of Customization: The assistant is hardcoded with specific functionalities, and adding new features or customizations may require substantial modifications to the code.
If you have any suggestions or improvements to enhance the Voice Assistant, feel free to contribute to the code. The GitHub repository for the project is Voice Assistant.
Your contributions are valuable and can help make the Voice Assistant more efficient and user-friendly.
Note: The Voice Assistant is a personal project, and its functionalities may vary depending on GoogleBard API usage and other services. Use the Voice Assistant responsibly and abide by the API provider's terms and conditions.
- Special thanks to the creators of GoogleBard and other libraries used in the Voice Assistant.
- Thanks to the open-source community for providing valuable resources and tutorials.
Disclaimer: This project is for educational and personal use only. The author does not take responsibility for any misuse or unintended consequences of the Voice Assistant. Use the Voice Assistant responsibly and within the boundaries of applicable laws and regulations.