A Python-based voice-activated AI assistant that listens to voice commands and responds with intelligent answers, web browsing, music playback, and more.
- main.py - Main voice assistant application
- music_libary.py - Music library with song links
- Voice Commands: Understands and processes natural voice commands
- AI Responses: Powered by Google Gemini 2.5 Flash for intelligent conversations
- Text-to-Speech: Responds using Google Text-to-Speech (gTTS)
- Web Browsing: Can open websites and search on Google
- Music Playback: Play songs from your music library
- News Headlines: Fetch and read the latest news
- Time & Date: Tell current time and date
- Music Library: Pre-loaded with curated songs
- Speech Recognition: Google Speech Recognition API
- Text-to-Speech: Google Text-to-Speech (gTTS)
- AI Engine: Google Gemini 2.5 Flash API
- Audio Processing: pygame
- Web Browser Control: webbrowser module
- HTTP Requests: requests library
speech_recognition
google-generativeai
gtts
pygame
requests
-
Install dependencies:
pip install speech_recognition google-generativeai gtts pygame requests
-
Ensure your microphone is connected and configured
python main.py- "What is your name?" - Responds with "I am Agentis, your personal assistant"
- "Stop" / "Exit" / "Quit" - Deactivates the assistant
- "What time is it?" - Returns current time
- "What's the date?" - Returns current date
- "Open Google" - Opens Google search
- "Open YouTube" - Opens YouTube
- "Open Brave" - Opens Brave browser
- "Open [website]" - Opens any website (e.g., "Open GitHub")
- "Search for [query]" - Searches Google for your query
- "Play [song name]" - Plays a song from the library
- Available songs: stealth, march, skyfall, wolf
- "News" - Reads the latest top news headlines
- Any other voice input is sent to Gemini AI for an intelligent response
Current songs in the library:
- Stealth - https://www.youtube.com/watch?v=U47Tr9BB_wE
- March - https://www.youtube.com/watch?v=Xqeq4b5u_Xw
- Skyfall - https://www.youtube.com/watch?v=DeumyOzKqgI
- Wolf - https://www.youtube.com/watch?v=ThCH0U6aJpU
To add more songs, edit the music_libary.py file and add entries to the music dictionary.
- API keys are currently hardcoded in the source. Move them to environment variables for production use
- Requires a working microphone and internet connection
- Google News API key is included but should be replaced with your own
Main application with:
speak(text)- Converts text to speech and plays itai_response(prompt)- Generates AI responses using Geminiprocesscommand(voice)- Processes and executes voice commands- Main loop for listening and responding
Dictionary of songs with YouTube links for music playback
You can customize:
- Add more songs to the music library in
music_libary.py - Modify AI prompts in the
ai_response()function - Add new commands in the
processcommand()function - Change greeting messages and responses
This project is provided for educational and personal use.