Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mr. Grip — AI Voice Assistant

A Python-based voice assistant that listens, thinks, and talks back — built as a learning project to understand speech recognition, LLM tool-calling, and text-to-speech pipelines.

What It Does

  • 🎤 Listens to your voice via microphone (Google Speech Recognition)
  • 🧠 Thinks using Gemini AI, which decides which tool to call based on what you ask
  • 🌦️ Weather — fetches live conditions for any city (OpenWeather API)
  • 📰 News — pulls top 3 headlines from India (NewsAPI)
  • 📖 Wikipedia — summarizes any topic in 2-3 sentences
  • ▶️ YouTube — opens search results for a query
  • 🔊 Speaks the response back out loud (pyttsx3)

How It Works

Your voice → Speech Recognition → Gemini (decides tool) → API call → Response → Text-to-Speech

Gemini uses function calling to automatically route your request to the right tool — you don't need to say "check weather," it figures out intent from natural conversation.

Tech Stack

  • speech_recognition — voice input
  • pyttsx3 — voice output
  • google-genai — Gemini API client with function calling
  • requests — weather and news API calls
  • wikipedia — fast Wikipedia summaries
  • python-dotenv — API key management

Setup

  1. Clone the repo and install dependencies:
pip install -r requirements.txt
  1. Create a .env file in the project root:
GEMINI_API_KEY=your_key_here
OPENWEATHER_API_KEY=your_key_here
NEWS_API_KEY=your_key_here
  1. Run it:
python main.py

Say "exit", "stop", or "sleep" to shut it down.

Honest Notes on This Project

This started from a YouTube tutorial that used Selenium browser automation for Wikipedia and YouTube search. I followed that approach first, but it was slow (5-6 seconds per query, full Chrome browser boot each time) and felt like the wrong tool for what modern AI APIs can do directly.

I rebuilt the Wikipedia and YouTube modules using direct API/library calls instead of browser automation, cutting response times from ~8-10 seconds down to ~2-3 seconds.

I used Gemini extensively as a debugging and design partner throughout — including diagnosing why the text-to-speech engine would go silent after the first response (turned out pyttsx3's event loop breaks on reuse — fixed by reinitializing the engine per call) and understanding Gemini's free-tier rate limits when I hit a 429 quota error mid-testing.

This is a prototype, not a finished product. Known limitations below.

Known Limitations

  • Free tier Gemini API caps at a limited number of requests/day — you will hit this with heavy testing
  • No conversation memory persistence between sessions
  • YouTube tool opens search results rather than auto-playing the first video (removed Selenium auto-click for speed; could be re-added with a YouTube Data API call)
  • CLI-only, no GUI/web frontend yet
  • Single-user, runs locally — not deployed

Acknowledgments

Inspired by a YouTube tutorial on Selenium-based voice assistants. Rebuilt and extended with Gemini API for the reasoning layer and faster, non-Selenium data fetching.

About

AI voice assistant powered by Gemini LLM — listens, thinks, and talks back using speech recognition, function calling, and live APIs for weather, news, Wikipedia & YouTube.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages