A Python-powered radio bot that generates personalized motivational quotes using Google's Gemini CLI and converts them to speech for your daily inspiration! This project showcases the integration of Google's powerful Gemini AI model through their command-line interface with Python automation.
- 🤖 AI-Powered Quotes: Uses Google Gemini CLI to generate unique motivational quotes
- 🛠️ Gemini CLI Integration: Seamlessly integrates with Google's official Gemini command-line interface
- 🔊 Text-to-Speech: Converts quotes to audio using Google Text-to-Speech (gTTS)
- 🎵 Auto-Play: Automatically plays the generated audio
- 🌈 Beautiful Terminal UI: Features loading spinners, step-by-step progress, and colorful output
- 💾 Audio Saving: Saves generated quotes as MP3 files for later listening
- 🔄 Dynamic Content: Requests different motivational quotes each time you run it
======================================================================
🎙️ AI RADIO BOT
======================================================================
🚀 Starting your daily dose of inspiration...
======================================================================
📍 STEP 1: INITIALIZING AI RADIO BOT
📍 STEP 2: GENERATING MOTIVATIONAL QUOTE
📍 STEP 3: QUOTE GENERATED!
✨ TODAY'S MOTIVATIONAL QUOTE ✨
💬 "The best way to predict the future is to create it."
📍 STEP 4: CONVERTING TO AUDIO
📍 STEP 5: PLAYING AUDIO
🎉 AI RADIO BOT SESSION COMPLETE! 🎉
- Python 3.7+ - Main programming language
- Node.js and npm - Required for Gemini CLI installation
- Google Gemini CLI - Official command-line interface for Google's Gemini AI
- Internet connection - For AI communication and TTS services
The Google Gemini CLI is Google's official command-line interface for interacting with their Gemini AI models. It provides:
- Direct access to Gemini 2.5 Pro and other models
- Interactive chat sessions
- File processing capabilities
- Web search integration
- Customizable AI interactions
Learn more:
-
Clone the repository
git clone https://github.com/Aditya7248/ai-radio-bot.git cd ai-radio-bot
-
Install Python dependencies
pip install gtts
-
Install Google Gemini CLI
npm install -g @google/gemini-cli
Verify installation:
gemini --version
-
Set up Gemini CLI (First time setup)
gemini config
Follow the prompts to authenticate with your Google account.
Simply run the script:
python radio_bot.py
The bot will:
- Connect to Gemini AI
- Generate a unique motivational quote
- Convert it to speech
- Play the audio
- Save the MP3 file for later
radio_bot.py
- Main script with all functionalitymotivational_quote.mp3
- Generated audio file (created after first run)
Beautiful animated spinners show real-time progress:
- 🤖 Connecting to Gemini AI...
- 📝 Sending quote request...
- 🧠 Gemini is thinking...
- 🔊 Converting text to speech...
- Uses Google Gemini AI through the official CLI for unique, personalized quotes
- Leverages Gemini's advanced language understanding and creativity
- Subprocess communication with the Gemini CLI for seamless integration
- Requests different quotes each time to ensure variety
- Intelligent response parsing to extract clean quotes
- Fallback quotes if AI is unavailable
- Smart quote extraction from AI response
- High-quality text-to-speech using Google TTS
- Automatic playback on Windows (using winsound)
- MP3 file saving for offline listening
- Error handling for audio issues
You can modify the prompt in get_quote_from_gemini()
function:
prompt = "Give me a short inspiring motivational quote to start the day under 30 words. And eveytime give me different motivational quote.\n"
-
"gemini command not found"
- Ensure Gemini CLI is installed:
npm install -g @google/gemini-cli
- Check if it's in PATH:
gemini --version
- On Windows, restart your terminal after installation
- Ensure Gemini CLI is installed:
-
Gemini CLI authentication issues
- Run
gemini config
to set up authentication - Ensure you have a valid Google account
- Check internet connection
- Run
-
"No module named 'gtts'"
- Install gTTS:
pip install gtts
- Use the correct Python version if you have multiple installed
- Install gTTS:
-
Audio not playing
- The MP3 file is still saved in the directory
- Check your system audio settings
-
Timeout errors
- Check your internet connection
- Gemini AI might be temporarily slow
Feel free to fork this project and submit pull requests! Some ideas for improvements:
- Add more TTS language options
- Create a GUI version
- Add quote categories (fitness, business, etc.)
- Integration with other AI models
- Scheduling for daily quotes
This project is open source and available under the MIT License.
- Google Gemini AI & CLI - For providing powerful AI capabilities and excellent command-line tools
- Google Text-to-Speech - For high-quality audio conversion
- The Python community - For excellent libraries and subprocess handling
- npm community - For seamless package management
- 📖 Google Blog: Introducing Gemini CLI - Open Source AI Agent
- 💻 Gemini CLI Official GitHub Repository
- 📦 Gemini CLI npm Package