Skip to main content

Google Gemini AI Provider Plugin

The Google Gemini plugin connects Ever Works to Google's Gemini models, offering an exceptionally large context window (up to 1 million tokens), built-in embedding models, and vision capabilities. It extends BaseAiProvider and communicates with Google's API through an OpenAI-compatible endpoint.

Source: packages/plugins/google/src/google.plugin.ts

Overview

PropertyValue
Plugin IDgoogle
Package@ever-works/google-plugin
Categoryai-provider
Capabilitiesai-provider
Version1.0.0
Configuration Modeuser-required
Provider Typegoogle
Auto-enableNo
Built-inYes
Visibilitypublic

Architecture

Google provides an OpenAI-compatible API endpoint at https://generativelanguage.googleapis.com/v1beta/openai/, which means the plugin reuses the same LangChain OpenAI provider with a custom baseURL.

Configuration

Settings Schema

SettingTypeRequiredDefaultScopeWidgetDescription
apiKeystringYes--user--Google AI API key. Secret.
defaultModelstringYesmodels/gemini-2.5-flashglobalmodel-selectDefault model for all AI tasks.
simpleModelstringNomodels/gemini-2.0-flashglobalmodel-selectModel for tags, descriptions, classifications.
mediumModelstringNomodels/gemini-2.5-flashglobalmodel-selectModel for listings, summaries, reformatting.
complexModelstringNomodels/gemini-2.5-proglobalmodel-selectModel for full page generation, multi-step analysis.
temperaturenumberNo0.7----Sampling temperature (0--2). Hidden.
maxTokensnumberNo4096----Max tokens per response. Hidden.
baseUrlstringNohttps://generativelanguage.googleapis.com/v1beta/openai/----API endpoint. Hidden.

Model Tiers

TierDefault ModelStrengths
Simplemodels/gemini-2.0-flashFast inference, low cost, good for structured extraction
Standardmodels/gemini-2.5-flashStrong reasoning with thinking, balanced performance
Complexmodels/gemini-2.5-proAdvanced reasoning, best quality output

Model Naming Convention

Google Gemini models use a models/ prefix:

models/gemini-2.0-flash
models/gemini-2.5-flash
models/gemini-2.5-pro

Capabilities

CapabilitySupportedDetails
Structured OutputYesJSON mode and schema-constrained generation
StreamingYesServer-sent events for incremental responses
Tool CallingYesFunction calling for structured tasks
VisionYesImage analysis and understanding
Max Context Length1,048,576 tokens1M token context window

The 1 million token context window is the largest among all AI provider plugins, making Gemini ideal for processing large volumes of source material during work generation.

Context Window Comparison

ProviderMax Context
Google Gemini1,048,576 tokens
Mistral128,000 tokens
OpenAI (via OpenRouter)128,000 tokens
Anthropic (via OpenRouter)200,000 tokens

Usage Examples

// Chat completion
const response = await googlePlugin.createChatCompletion({
messages: [{ role: 'user', content: 'Describe this business' }],
settings: { apiKey: 'AIza...' }
});

// Streaming
for await (const chunk of googlePlugin.createStreamingChatCompletion({
messages: [{ role: 'user', content: 'Write a detailed description' }],
settings: { apiKey: 'AIza...' }
})) {
process.stdout.write(chunk.content ?? '');
}

// Embeddings
const embedding = await googlePlugin.createEmbedding({
input: 'text for semantic search'
});

// Structured JSON output
const result = await googlePlugin.askJson('Generate category taxonomy', {
settings: { apiKey: 'AIza...' }
});

// List available models
const models = await googlePlugin.listModels({ apiKey: 'AIza...' });

// Test connectivity
const available = await googlePlugin.isAvailable({ apiKey: 'AIza...' });

Configuration Mode

Google Gemini uses user-required configuration mode. Each user must provide their own Google AI API key -- there is no admin-level shared key option.

Why Use Gemini?

AdvantageDescription
Extended contextProcess up to 1M tokens -- ideal for large source documents
Embedding supportBuilt-in text-embedding models for semantic search
Cost-efficientGemini Flash models deliver strong results at low per-token cost
VisionAnalyze images and screenshots during content generation
Thinking modelsGemini 2.5 models use extended thinking for better reasoning

Lifecycle

Health Check

async healthCheck(): Promise<PluginHealthCheck> {
return {
status: 'healthy',
message: 'Google Gemini plugin is ready',
checkedAt: Date.now()
};
}

To verify API connectivity, call isAvailable() with a valid API key. This invokes testConnection() against the Google API.

Dependencies

PackageVersionPurpose
@ever-works/pluginworkspacePlugin contracts and base classes
@langchain/openai^0.6.17LangChain OpenAI-compatible provider
@langchain/core^0.3.80LangChain core abstractions

Getting Started

  1. Obtain an API key from Google AI Studio
  2. Enable the Google Gemini plugin in Ever Works
  3. Enter your API key in the settings
  4. Select preferred Gemini models for each task complexity level