Skip to content

Conversation

Copy link

Copilot AI commented Dec 20, 2025

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 gemini as a first-class provider with pre-configured base URL, default model, and environment variable support.

Key Capabilities

  1. Select "Google Gemini" directly in setup wizard
  2. Auto-configured base URL for OpenAI-compatible endpoint
  3. GEMINI_API_KEY environment variable support

Design Decisions

  • Decision: Use Google's OpenAI-compatible endpoint (generativelanguage.googleapis.com/v1beta/openai)
    • Rationale: No new SDK dependency; reuses existing OpenAI client
    • Alternatives considered: Native Gemini SDK (rejected: unnecessary complexity)

Implementation Details

Changes Made

Modified Files/Modules

  • src/config/config.ts - Added gemini to ApiProvider type and PROVIDER_CONFIG
  • src/core/validation.ts - Updated provider validation pattern
  • src/cli/ui.ts - Added Gemini to setup wizard options
  • README.md - Documented Gemini support, added gemini to provider options comment, and added beta API note

Technical Approach

Follows existing provider pattern. Gemini uses the same code path as other providers via OpenAI SDK compatibility.

Integration Points

  • Existing LLMClient handles Gemini via OpenAI-compatible API
  • configManager automatically applies Gemini base URL when selected

Usage Examples

Basic Usage

devvy setup
# Select option 4: Google Gemini
# Enter your API key from https://aistudio.google.com/apikey

Environment Variable

export GEMINI_API_KEY=your-key
devvy

Testing

Test Environment

  • Runtime: Node.js 18+
  • AI Provider: N/A (configuration only)

Test Cases

Functional Testing

  • Feature works as expected in happy path
  • Edge cases handled properly
  • Feature works with all supported providers

Impact Analysis

Components Affected

  • CLI/Terminal UI
  • Configuration System
  • Documentation

Breaking Changes

Breaking Changes: No

Backward Compatibility

  • Fully backward compatible

Dependencies

No new dependencies.

Performance Impact

  • Memory Impact: neutral
  • Execution Time: neutral
  • Startup Time: not affected
  • API Calls: neutral

Code Quality

  • Code follows project style guidelines
  • ESM imports use .js extensions
  • TypeScript strict mode compliance
  • Comprehensive error handling
  • Functions are properly typed
  • Consistent naming conventions

Documentation

  • Updated README.md with feature description
  • Updated CLI help text
  • Added usage examples
  • Documented configuration options
  • Added beta API endpoint note for Gemini

Security

  • No API keys or secrets in code
  • Input validation implemented
  • No new security vulnerabilities

Build & Validation

  • npm run build succeeds
  • npm run lint passes

User Experience

Usability Considerations

  • Feature is discoverable
  • Feature follows existing patterns

Future Enhancements

Known Limitations

  1. Model list fetching depends on Gemini API supporting the /models endpoint
  2. Gemini support uses beta API endpoint (v1beta) which may have breaking changes or stability issues - monitor for stable v1 endpoint availability

Potential Improvements

  1. Add Gemini-specific model suggestions in setup

Checklist

  • I have read and followed the contributing guidelines
  • I have performed a self-review of my code
  • I have tested the feature thoroughly
  • I have verified backward compatibility
  • I have updated all relevant documentation

For Reviewers

Focus Areas

  • Provider configuration in src/config/config.ts
  • Setup wizard flow in src/cli/ui.ts

Demo Instructions

  1. Run node dist/index.js setup
  2. Select option 4 (Google Gemini)
  3. Verify API key URL hint appears
Original prompt

This section details on the original issue you should resolve

<issue_title>Add support for the Gemini API</issue_title>
<issue_description>Please add support for the Gemini API in the Devvy AI agent.</issue_description>

<agent_instructions>Make sure to review everything with Copilot Code review. Implement fixes until there are no comments left. And the build and tests and lint must pass.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 20, 2025 15:30
Co-authored-by: Githubguy132010 <145768128+Githubguy132010@users.noreply.github.com>
Co-authored-by: Githubguy132010 <145768128+Githubguy132010@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for the Gemini API in Devvy AI agent Add support for the Gemini API Dec 20, 2025
Copy link

Copilot AI left a 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 gemini as 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
Copy link

Copilot AI Dec 20, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Author

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',
Copy link

Copilot AI Dec 20, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Author

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.

@Githubguy132010
Copy link
Owner

@copilot apply changes based on the comments in this thread

Co-authored-by: Githubguy132010 <145768128+Githubguy132010@users.noreply.github.com>
Copy link
Author

Copilot AI commented Dec 20, 2025

@copilot apply changes based on the comments in this thread

Applied both changes from the review thread in commit ba8f160:

  1. Updated the provider comment in README.md to include gemini
  2. Added a beta API note for Gemini in the Supported Providers section

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.

Add support for the Gemini API

2 participants