A Python-based application for interacting with Google's Gemini AI models through both text and voice interfaces.
- 💬 Text-based communication with Gemini AI models
- 🎤 Voice communication capabilities for English practice
- 🤖 Multiple Gemini model options (gemini-2.0-flash, gemini-2.0-pro-exp, gemini-2.0-flash-thinking)
- 🌐 English speaking practice with pronunciation feedback
- 📝 Customizable system instructions
- 🔐 Secure API key storage for convenience
- Python 3.10+
- Google API key (obtainable from https://aistudio.google.com/apikey)
- Internet connection
# Clone the repository
git clone https://github.com/yourusername/EasyChat.git
# Navigate to project directory
cd EasyChat
# Install required packages
pip install google-generativeai websockets websockets-proxy rich elevenlabs pyaudio
For security and convenience, it's strongly recommended to add your Google API key as an environment variable:
setx GOOGLE_API_KEY "your-api-key-here"
Note: You'll need to restart your command prompt or IDE after setting this.
echo 'export GOOGLE_API_KEY="your-api-key-here"' >> ~/.bashrc
source ~/.bashrc
For zsh users, use ~/.zshrc
instead.
This approach:
- Keeps your API key secure (not exposed in code)
- Makes the application work seamlessly across sessions
- Prevents accidental sharing of your key in version control
After setting the environment variable, the application will automatically detect and use it without prompting.
Run the main script:
python gemini.py
- When prompted, enter your Google API key (or press 'y' if you've set it as an environment variable)
- Select option "2" for Text Communication
- Choose your preferred Gemini model
- Optionally provide a system instruction
- Start chatting with the AI
- When prompted, enter your Google API key (or press 'y' if you've set it as an environment variable)
- Select option "1" for Voice Communication
- Use your microphone to practice English speaking
- Receive pronunciation feedback and corrections
- gemini-2.0-flash: Fast, efficient model suitable for everyday conversations
- gemini-2.0-pro-exp: Advanced model with expanded capabilities for complex tasks
- gemini-2.0-flash-thinking: Specialized model with "thinking out loud" capabilities
- API Key Issues: Ensure your Google API key is valid and has access to Gemini models
- Audio Problems: Check your microphone settings and permissions
- Connection Issues: Verify your internet connection and proxy settings if applicable
- Package Errors: Make sure all dependencies are correctly installed with the right versions
Contributions are welcome! If you'd like to improve EasyChat:
- Fork the repository
- Create a feature branch:
git checkout -b new-feature
- Commit your changes:
git commit -am 'Add new feature'
- Push to the branch:
git push origin new-feature
- Submit a pull request
EasyChat is designed for those who want to use free AI models for:
- English language practice with pronunciation feedback
- General AI assistance through text conversations
- Testing different capabilities of Google's Gemini models
This project is licensed under the MIT License - see the LICENSE file for details.