-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for the Gemini API #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Githubguy132010 <145768128+Githubguy132010@users.noreply.github.com>
Co-authored-by: Githubguy132010 <145768128+Githubguy132010@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds Google Gemini as a first-class supported API provider to Devvy, allowing users to select Gemini directly from the setup wizard instead of configuring it as a custom provider. The implementation follows the existing provider pattern and leverages Google's OpenAI-compatible API endpoint, requiring no new dependencies.
Key Changes
- Added
geminias a new ApiProvider type with pre-configured settings (base URL, default model, environment variable) - Updated the setup wizard to include Google Gemini as option 4, with "Custom" moved to option 5
- Enhanced documentation with Gemini-specific instructions and environment variable examples
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/config/config.ts | Added Gemini provider configuration with base URL, default model (gemini-2.0-flash), and GEMINI_API_KEY environment variable |
| src/core/validation.ts | Updated provider validation regex to include 'gemini' as a valid option |
| src/cli/ui.ts | Added Gemini as option 4 in setup wizard menu and included API key URL hint for Google AI Studio |
| README.md | Updated documentation to list Gemini in supported providers and environment variables section |
| package-lock.json | Added npm lock file (note: project primarily uses bun.lock) |
| export OPENAI_API_KEY=your-key # For OpenAI | ||
| export ANTHROPIC_API_KEY=your-key # For Anthropic | ||
| export OPENROUTER_API_KEY=your-key # For OpenRouter | ||
| export GEMINI_API_KEY=your-key # For Google Gemini |
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example command in README.md line 75-76 shows "openrouter" as an example but should be updated to include "gemini" as one of the valid options. The comment should read: "# Set provider (openai, anthropic, openrouter, gemini, custom)" to reflect the newly added Gemini provider support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the provider comment to include gemini in commit ba8f160.
| displayName: 'OpenRouter', | ||
| }, | ||
| gemini: { | ||
| baseUrl: 'https://generativelanguage.googleapis.com/v1beta/openai', |
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Gemini API base URL uses the "v1beta" path, which indicates this is a beta API endpoint. While this is functional, be aware that beta endpoints may have breaking changes or stability issues. Consider documenting this limitation in the README or adding a note in the setup wizard that Gemini support is based on a beta API. Monitor Google's documentation for when a stable v1 endpoint becomes available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added "(uses beta API endpoint)" note to the Google Gemini entry in the Supported Providers section in commit ba8f160.
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: Githubguy132010 <145768128+Githubguy132010@users.noreply.github.com>
Applied both changes from the review thread in commit ba8f160:
|
Feature Pull Request
Feature Summary
Adds Google Gemini as a supported API provider using Google's OpenAI-compatible endpoint.
Related Issue
Problem Statement
Users wanting to use Google's Gemini models had no native support in Devvy.
Current Limitations
Only OpenAI, Anthropic, OpenRouter, and custom providers were supported.
User Pain Points
Users had to configure Gemini as a "custom" provider, manually setting the base URL and environment variable.
Proposed Solution
Feature Overview
Adds
geminias a first-class provider with pre-configured base URL, default model, and environment variable support.Key Capabilities
GEMINI_API_KEYenvironment variable supportDesign Decisions
generativelanguage.googleapis.com/v1beta/openai)Implementation Details
Changes Made
Modified Files/Modules
src/config/config.ts- AddedgeminitoApiProvidertype andPROVIDER_CONFIGsrc/core/validation.ts- Updated provider validation patternsrc/cli/ui.ts- Added Gemini to setup wizard optionsREADME.md- Documented Gemini support, addedgeminito provider options comment, and added beta API noteTechnical Approach
Follows existing provider pattern. Gemini uses the same code path as other providers via OpenAI SDK compatibility.
Integration Points
LLMClienthandles Gemini via OpenAI-compatible APIconfigManagerautomatically applies Gemini base URL when selectedUsage Examples
Basic Usage
Environment Variable
export GEMINI_API_KEY=your-key devvyTesting
Test Environment
Test Cases
Functional Testing
Impact Analysis
Components Affected
Breaking Changes
Breaking Changes: No
Backward Compatibility
Dependencies
No new dependencies.
Performance Impact
Code Quality
.jsextensionsDocumentation
Security
Build & Validation
npm run buildsucceedsnpm run lintpassesUser Experience
Usability Considerations
Future Enhancements
Known Limitations
/modelsendpointv1beta) which may have breaking changes or stability issues - monitor for stable v1 endpoint availabilityPotential Improvements
Checklist
For Reviewers
Focus Areas
src/config/config.tssrc/cli/ui.tsDemo Instructions
node dist/index.js setupOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.