-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: add Gemini-CLI provider support #6044
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
- Add GeminiCliHandler class to interface with gemini CLI tool - Implement OAuth authentication flow handling - Add telemetry collection for token usage tracking - Create UI component for provider configuration - Add comprehensive test coverage for the provider - Support both free and paid (project ID) usage modes Fixes #6043
@@ -0,0 +1,311 @@ | |||
import { spawn, ChildProcess } from "child_process" | |||
import { Anthropic } from "@anthropic-ai/sdk" | |||
import * as vscode from "vscode" |
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.
Remove unused import 'vscode' as it isn’t used in this provider.
import * as vscode from "vscode" |
This comment was generated because it violated a code review rule: irule_Vw7dJWzvznOJagxS.
if (needsAuth) { | ||
yield { | ||
type: "text", | ||
text: "Please authenticate with Google in your browser. Once authenticated, please retry your request.", |
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.
Internationalize user-facing authentication message instead of hardcoding plain text.
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
const usage = this.currentRequestId ? this.telemetryCollector.get(this.currentRequestId) : undefined | ||
|
||
resolve({ text, usage }) | ||
} catch (error) { |
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.
Consider logging the error caught during JSON parsing to aid debugging instead of silently falling back.
This comment was generated because it violated a code review rule: irule_PTI8rjtnhwrWq6jS.
return ( | ||
<> | ||
<div className="text-sm text-vscode-descriptionForeground"> | ||
Use Google Gemini models through the Gemini CLI, which provides free access to Gemini Pro through Google |
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.
Wrap user-facing texts in translation functions to support internationalization.
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
@hannesrudolph so what happens with this? It;'s just going to implement it itself? So you don't want my PR? |
Implements #6043 - Adds support for using Google Gemini models through the Gemini CLI, providing free access to Gemini Pro via Google Code Assist.
Summary
This PR adds a new provider that interfaces with the Gemini CLI tool, allowing users to access Google Gemini models including the free tier through Google Code Assist.
Changes
GeminiCliHandler
class that interfaces with thegemini
CLI commandFeatures
Testing
Usage
npm install -g @google/generative-ai-cli
Fixes #6043
Important
Adds
GeminiCliHandler
to support Google Gemini models via CLI with OAuth, telemetry, and UI configuration.GeminiCliHandler
ingemini-cli.ts
to interface withgemini
CLI.GeminiCli
component inGeminiCli.tsx
for UI settings.ApiOptions.tsx
andconstants.ts
to include Gemini CLI provider.gemini-cli.spec.ts
for provider functionality.gemini-cli.ts
.This description was created by
for 41d96f1. You can customize this summary. It will automatically update as commits are pushed.