Skip to content

feat: add Google Gemini provider#177

Open
AasheeshLikePanner wants to merge 1 commit intolemony-ai:mainfrom
AasheeshLikePanner:feature/gemini-provider
Open

feat: add Google Gemini provider#177
AasheeshLikePanner wants to merge 1 commit intolemony-ai:mainfrom
AasheeshLikePanner:feature/gemini-provider

Conversation

@AasheeshLikePanner
Copy link

🎯 Description

  • Add GeminiProvider with support for all Gemini models (1.5, 2.0, 2.5, 3.x)
  • Support for completion, streaming, and tool calling
  • Updated pricing for latest models (March 2026):
    • Gemini 3.1 Pro Preview: $2.00/$12.00 per 1M tokens
    • Gemini 3.1 Flash Preview: $0.50/$3.00 per 1M tokens
    • Gemini 3.1 Flash-Lite Preview: $0.25/$1.50 per 1M tokens
    • Gemini 2.5 Pro: $1.25/$10.00 per 1M tokens
    • Gemini 2.5 Flash: $0.30/$2.50 per 1M tokens
    • Gemini 2.5 Flash-Lite: $0.10/$0.40 per 1M tokens
  • Automatic retry logic with exponential backoff
  • HTTP config support for enterprise SSL/proxy
  • Fix agent module export in cascadeflow/init.py

Tested with real API key - working correctly.

🔗 Related Issues

  • Related to #

🔄 Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🚀 New provider integration
  • 🤖 Tool calling / function support

🧪 Testing

Test cases added

  • Manual testing

How to test

from cascadeflow.providers import PROVIDER_REGISTRY
from cascadeflow.providers.gemini import GeminiProvider
import os
os.environ['GEMINI_API_KEY'] = 'your-key'

provider = GeminiProvider()
response = await provider.complete(
    prompt="What is Python?",
    model="gemini-2.5-flash"
)
print(response.content)

📋 Checklist

Code Quality

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • My changes generate no new warnings
  • I have added type hints where appropriate
  • I have run `black` to format my code
  • I have run `ruff` and fixed all linting issues
  • I have run `mypy` for type checking

Testing

  • New and existing unit tests pass locally with my changes
  • Tested with real Gemini API key

Breaking Changes

  • This PR includes NO breaking changes

By submitting this PR, I confirm that:

  • I have read and followed the CONTRIBUTING.md guidelines
  • My contribution is my own original work or properly attributed
  • I agree to license my contribution under the project's MIT license
  • I have tested my changes thoroughly

- Add GeminiProvider with support for all Gemini models (1.5, 2.0, 2.5, 3.x)
- Support for completion, streaming, and tool calling
- Updated pricing for latest models (March 2026):
  - Gemini 3.1 Pro: .00/.00 per 1M tokens
  - Gemini 3.1 Flash: /bin/zsh.50/.00 per 1M tokens
  - Gemini 3.1 Flash-Lite: /bin/zsh.25/.50 per 1M tokens
  - Gemini 2.5 Pro: .25/.00
  - Gemini 2.5 Flash: /bin/zsh.30/.50
  - Gemini 2.5 Flash-Lite: /bin/zsh.10//bin/zsh.40
- Automatic retry logic with exponential backoff
- HTTP config support for enterprise SSL/proxy
- Fix agent module export in __init__.py

Tested with real API key - working correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant