Skip to content

2187Nick/discord-voice-to-voice-gemini

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-time voice to voice Gemini discord chat bot

Chat voice to voice live with Google's Gemini 2.0 AI with google search capabilities.

Demo

scarlett.mp4

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/2187Nick/discord-voice-to-voice-gemini
cd discord-voice-to-voice-gemini
  1. Install required packages:
pip install -r requirements.txt
  1. Create a .env file in the project root with the following variables:
DISCORD_TOKEN=your_discord_bot_token
GEMINI_API_KEY=your_gemini_api_key
  1. Options:
  • Set the voice to use in main.py line 22.
voice="aoede"
  • Set the persona to use in main.py line 23.
persona="Take on the persona of an overly excited motivational speaker"

Usage

  1. Start the bot:
python main.py
  1. In Discord, join a voice channel and use the following command:
/chat
  1. Enable push-to-talk in Discord and hold the key while speaking.

  2. Interrupt the response by pressing the key again and start speaking.

Commands

  • /chat - Initiates a voice chat session with the bot
  • /stop - Stops the current voice chat session

Support

https://x.com/2187Nick

http://discord.gg/vxKepZ6XNC

Project Structure

├── main.py # Bot initialization and command handling
└── src/ 
    ├── record.py # Audio processing and speech-to-text conversion 
    ├── stream.py # Custom audio streaming implementation 
    └── gemini.py # Gemini AI WebSocket client integration

Technical Details

  • Uses Discord.py for bot functionality
  • Implements custom audio streaming for real-time voice processing
  • Uses WebSocket connection to Gemini AI for real-time responses
  • Handles both synchronous and asynchronous operations for optimal performance

About

Talk with Gemini 2.0 by integrating it with your discord bot.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages