Vtron is a Python-based personal digital assistant that integrates various functionalities including voice recognition, text-to-speech, web searches, and more. It provides a GUI interface and can perform tasks such as sending emails, fetching news, and providing weather updates.
- Voice Recognition: Uses speech recognition to understand and execute voice commands.
- Text-to-Speech: Converts text responses to speech using the
pyttsx3
library. - OpenAI Integration: Interacts with OpenAI's API to provide responses based on user queries.
- Web Functionalities: Includes capabilities to search Wikipedia, Google, play YouTube videos, and more.
- GUI Interface: A Tkinter-based GUI with an image and terminal display.
- And many more...!
- Saptarshi Bose
Ensure you have Python 3.8 or higher installed. You can download Python from python.org.
-
Create a Virtual Environment :
E:\Vtron\v\Scripts\python.exe -m venv vtron-env
-
Activate the Virtual Environment :
-
On Windows :
vtron-env\Scripts\activate
-
On macOS/Linux :
source vtron-env/bin/activate
-
-
Clone the Repository :
git clone <repository-url> cd <repository-directory>
-
Install Required Packages :
# Vtron Project Packages 1. requests - For making HTTP requests to external APIs. 2. wikipedia - To fetch information from Wikipedia. 3. pywhatkit - For interacting with WhatsApp, YouTube, and Google searches. 4. webbrowser - To open URLs in the default web browser. 5. email.message (EmailMessage) - For creating email messages. 6. smtplib - For sending emails via the SMTP protocol. 7. decouple - For managing environment variables from a `.env` file. 8. speech_recognition - For converting spoken words into text. 9. pyttsx3 - For text-to-speech conversion. 10. keyboard - For detecting keyboard hotkeys. 11. os - For interacting with the operating system. 12. tkinter - For building the graphical user interface (GUI). 13. threading - For handling concurrent tasks. 14. time - For managing time-related tasks. 15. datetime - For date and time manipulation. 16. pyjokes - For generating random jokes.
Create a .env
file in the root directory of your project with the following variables:
USER=YourUsername
BOT=Vtron
OPENAI_API_KEY=your_openai_api_key
WOLFRAM_ALPHA_APP_ID=your_wolfram_alpha_app_id
EMAIL=your_email@example.com
PASSWORD=your_email_password
NEWSAPI_KEY=your_newsapi_key
OPENWEATHER_API_KEY=your_openweather_api_key
-
Run the Application :
python main.py
-
Voice Commands :
- Activate Listening: Press Ctrl+Alt+K
- Pause Listening: Press Ctrl+Alt+P
- Start OpenAI: Say "activate open ai" or "start open ai"
- Stop OpenAI: Say "deactivate open ai"
- main.py: Contains the main application logic and GUI setup.
- online.py: Contains functions for online interactions (e.g., web searches, sending emails).
- convo.py: Contains response data and random text used in interactions.
- Voice Inputs Not Working: Ensure your microphone is correctly set up and permissions are granted.
- API Errors: Check your API keys and ensure they are correctly set in the .env file.
- Image Display: The left half of the Tkinter GUI displays a GIF or picture of AI.
- Terminal: The right half of the Tkinter GUI acts as a chat terminal.
- Commands for starting and stopping OpenAI interactions are implemented in the
process_input()
function.
- Ensure
window
is used instead ofroot
for Tkinter window naming. - The
test_chat
function and test button have been removed from the Tkinter GUI as per the project requirements. - The
listening = False
state is used initially, with functionsstart_listening()
andpause_listening()
triggered by keyboard hotkeys (Ctrl+Alt+K to start listening, and Ctrl+Alt+P to pause listening). - The Vtron thread logic is kept inside its own function and not mixed with specific command handling logic.