A Python application for having voice and video conversations with Google's new Gemini 2.0 model. Features real-time voice and video input and audio responses. Available in two versions: a full-stack web application and a standalone Python script.
gemini.playground.full.stack.mp4
- Go to Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the generated API key and paste it into the appropriate .env file
- Python 3.12 or higher
- Node.js 18 or higher
- A Google Cloud account
- A Gemini API key
- Clone this repository
- Create a virtual environment and activate it:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install the required packages:
pip install -r requirements.txt
- Create a
.env
file in the root directory with your API key:
GEMINI_API_KEY=your_api_key_here
- Start the backend server:
python backend/main.py
- Navigate to the frontend directory:
cd frontend
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Open http://localhost:3000 in your browser
playground.demo.mp4
Same as above, but only Python-related requirements are needed and Tkinter:
- On Ubuntu/Debian:
sudo apt-get install python3-tk
- On Fedora:
sudo dnf install python3-tkinter
- On macOS & Windows: Already included with Python
-
Clone this repository or download the standalone folder
-
Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install the required packages:
pip install -r requirements.txt
- Create a
.env
file in the standalone directory with your API key:
GEMINI_API_KEY=your_api_key_here
- Make sure your virtual environment is activated
- Run the script:
python standalone.py
Both versions provide several configuration options:
- System Prompt: The initial instructions given to Gemini about its role and behavior
- Voice: Choose from different voice options for Gemini's responses:
- Puck
- Charon
- Kore
- Fenrir
- Aoede
- Enable Google Search: Allows Gemini to search the internet for current information
- Allow Interruptions: Enables interrupting Gemini while it's speaking
- Audio feedback loop issue - Gemini may interrupt itself when it detects its own voice output through your microphone. This occurs because the application processes all incoming audio, including Gemini's responses. To prevent this feedback loop, either:
- Disable the "Allow Interruptions" option in settings
- Use headphones/earphones to prevent your microphone from picking up Gemini's audio output