A voice-enabled AI chatbot powered by Google Gemini 2.5 Flash Lite, featuring a web interface with a visualiser orb and a Python CLI speaking assistant.
- Web UI — Chat via browser with a pulsing visualiser orb that reacts to conversation states (Idle → Listening → Thinking → Speaking)
- Python CLI — Terminal chatbot with native text-to-speech via
pyttsx3 - Gemini 2.5 Flash Lite — Fast, efficient responses through the Gemini API
- Secure API key handling — Key loaded from
.env, never hardcoded
- Go to Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the key — you'll need it in the next step
git clone https://github.com/parekhrohan21/gemini_chatbot.git
cd gemini_chatbotCreate a .env file in the root of the project:
cp .env.example .envThen open .env and replace the placeholder with your actual key:
GEMINI_API_KEY=your_api_key_here
Important
Never share or commit your .env file. It is already listed in .gitignore.
npm install
npm startOpen your browser at http://localhost:3000.
Orb States:
| State | Appearance |
|---|---|
| Idle | Pulsing blue orb |
| Listening | Red glow, active pulse |
| Thinking | Fast white spin |
| Speaking | Ripple effect |
pip install google-generativeai python-dotenv pyttsx3
python main.pyType your message and press Enter. Say quit, exit, or bye to end the session.
gemini_chatbot/
├── public/ # Frontend (HTML, JS, CSS)
├── server.js # Express backend — handles Gemini API calls
├── main.py # Python CLI chatbot with text-to-speech
├── .env.example # Template for environment variables
├── .env # Your local API key (gitignored)
└── package.json