feat: add Google Gemini provider#177
Open
AasheeshLikePanner wants to merge 1 commit intolemony-ai:mainfrom
Open
feat: add Google Gemini provider#177AasheeshLikePanner wants to merge 1 commit intolemony-ai:mainfrom
AasheeshLikePanner wants to merge 1 commit intolemony-ai:mainfrom
Conversation
- 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.
saschabuehrle
requested changes
Mar 27, 2026
Collaborator
saschabuehrle
left a comment
There was a problem hiding this comment.
Thanks for the contribution. I reviewed and validated against current main. This PR is not merge-ready yet.
Required fixes before merge:
- Tool calling path is broken at runtime
_check_tool_support()returnsTrue, but_complete_with_tools_impl()is not implemented.- With
tools=..., BaseProvider routes to_complete_with_tools_impl()and raisesNotImplementedError.
- Gemini request body shape is incorrect
systemInstructionandtoolsare currently placed insidegenerationConfig.- They must be top-level request fields for Gemini
generateContentrequests.
- Streaming path likely mismatched
- Current code parses SSE
data:lines but does not configure SSE mode consistently for Gemini streaming. - Ensure endpoint/query mode and parser match real Gemini stream format.
- Incorrect latency metric
latency_msis currently set frompromptTokenCount(token count, not latency).- Use measured elapsed time for latency.
- Add provider tests
- Need targeted tests for: complete(), stream(), tool-calling path, and usage/cost parsing.
Also, this PR includes unrelated cascadeflow.agent export changes. Please keep provider work focused (or split into separate PRs).
Please address these and re-request review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Description
Tested with real API key - working correctly.
🔗 Related Issues
🔄 Type of Change
🧪 Testing
Test cases added
How to test
📋 Checklist
Code Quality
Testing
Breaking Changes
By submitting this PR, I confirm that: