N.Y.R.A (Nimble Yet Reliable Assistant) is a voice-activated Python AI assistant designed to handle everyday tasks like playing music, fetching news, opening websites, and responding with AI-generated replies using Google's Gemini Pro.
-
ποΈ Voice Command Recognition
Say "Nyra" to activate the assistant and issue voice commands. -
π Open Websites
Commands like βopen Googleβ, βopen YouTubeβ, etc. -
π΅ Play Music
Ask N.Y.R.A to play a song from your predefined library. -
ποΈ Fetch Latest News
Get the latest headlines using NewsAPI. -
π§ AI-Powered Conversations
Chat with N.Y.R.A using Google's Gemini Pro. -
π Text-to-Speech
Replies are spoken using Google's gTTS and played with Pygame.
speech_recognition
β For speech-to-text from your microphonegoogle-generativeai
β For AI-generated text replies (Gemini Pro)gtts
β Converts text to speechpygame
β Plays the MP3 speech outputrequests
β For fetching news from NewsAPIdotenv
β For secure API key managementwebbrowser
β Opens web URLs in the default browser
AI_ASSIS/
βββ .env.example # Sample environment config
βββ hello.mp3 # Sample MP3 file (optional)
βββ main.py # Main assistant logic
βββ musicLibrary.py # Dictionary of songs mapped to YouTube links
βββ requirements.txt # List of dependencies
βββ README.md # This file
git clone https://github.com/yourusername/nyra-assistant.git
cd nyra-assistant
python -m venv .venv
# Activate it:
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate
pip install -r requirements.txt
Create a .env
file with your API keys:
NEWS_API_KEY=your_newsapi_key
GEMINI_API_KEY=your_gemini_api_key
Or copy from example:
cp .env.example .env
python main.py
Speak "Nyra" to activate voice recognition.
- "Nyra" β Wake word
- "Open Google"
- "Play [song name]"
- "Give me the news"
- "What's the capital of France?"
- You can customize the music list in
musicLibrary.py
. - Avoid committing your
.env
file β keep your API keys safe! - Internet connection is required for news, AI, and TTS features.
This project is open-source and available under the MIT License.
Developed with β€οΈ by Sarthak Dharmik