Add Google Gemini as AI provider

- Add gemini.py provider using google-genai SDK
- Update config.py with gemini provider and GEMINI_API_KEY
- Update ai_service.py factory to support gemini
- Add google-genai to requirements.txt
- Update .env.example, README.md, and CLAUDE.md documentation
This commit is contained in:
2026-01-11 20:23:03 +01:00
parent b05fa034a6
commit 5761529c7f
8 changed files with 89 additions and 7 deletions

View File

@@ -4,7 +4,7 @@ A customizable Discord bot that responds to @mentions with AI-generated response
## Features
- **Multi-Provider AI**: Supports OpenAI, OpenRouter, and Anthropic (Claude)
- **Multi-Provider AI**: Supports OpenAI, OpenRouter, Anthropic (Claude), and Google Gemini
- **Fully Customizable**: Configure bot name, personality, and behavior
- **Conversation Memory**: Remembers context per user
- **Easy Deployment**: Docker support included
@@ -50,10 +50,11 @@ All configuration is done via environment variables in `.env`.
| Variable | Description |
|----------|-------------|
| `DISCORD_TOKEN` | Your Discord bot token |
| `AI_PROVIDER` | `openai`, `openrouter`, or `anthropic` |
| `AI_PROVIDER` | `openai`, `openrouter`, `anthropic`, or `gemini` |
| `OPENAI_API_KEY` | OpenAI API key (if using OpenAI) |
| `OPENROUTER_API_KEY` | OpenRouter API key (if using OpenRouter) |
| `ANTHROPIC_API_KEY` | Anthropic API key (if using Anthropic) |
| `GEMINI_API_KEY` | Google Gemini API key (if using Gemini) |
### Bot Identity
@@ -129,6 +130,7 @@ Mention the bot in any channel:
| OpenAI | gpt-4o, gpt-4-turbo, gpt-3.5-turbo | Official OpenAI API |
| OpenRouter | 100+ models | Access to Llama, Mistral, Claude, etc. |
| Anthropic | claude-3-5-sonnet, claude-3-opus | Direct Claude API |
| Gemini | gemini-2.0-flash, gemini-1.5-pro | Google AI API |
## Project Structure