Skip to content

Releases: ben-vargas/ai-sdk-provider-gemini-cli

v2.0.1

02 Jan 01:48
6e3d37d

Choose a tag to compare

2.0.1 - 2026-01-02

Fixed

  • Default function tool parameter schemas to type: "object" when only properties are provided (fixes Gemini function declaration validation error).

v2.0.0 - AI SDK v6 Support

29 Dec 08:40
1f1f1ae

Choose a tag to compare

Summary

Major release adding AI SDK v6 support. This makes v6 the primary version.

For AI SDK v5 compatibility, use npm install ai-sdk-provider-gemini-cli@ai-sdk-v5.

Breaking Changes

  • Provider interface: ProviderV2 → ProviderV3
  • Token usage: flat → hierarchical structure
  • Warning format: unsupported-settingunsupported
  • Method rename: textEmbeddingModel()embeddingModel()
  • Finish reason: string → { unified, raw } object

Dependencies

  • @ai-sdk/provider: ^3.0.0
  • @ai-sdk/provider-utils: ^4.0.1
  • @google/gemini-cli-core: 0.22.4

Installation

npm install ai-sdk-provider-gemini-cli ai

See CHANGELOG.md for full details.

v2.0.0-beta.2 - thinkingConfig support for Gemini 3

18 Dec 03:58
6bd2bf4

Choose a tag to compare

thinkingConfig Support for Gemini 3

Port of thinkingConfig from main branch (v1.5.1) for AI SDK v6 compatibility.

Added

  • thinkingConfig Support: Configure Gemini 3 thinking/reasoning mode

    • thinkingLevel for Gemini 3 models (gemini-3-pro-preview, gemini-3-flash-preview)
      • Supports values: low, medium, high, minimal
      • Case-insensitive string input ('HIGH', 'high', 'High' all work)
      • Also accepts ThinkingLevel enum for type-safe usage
    • thinkingBudget for Gemini 2.5 models (backwards compatible)
      • Token-based control: 0 (disabled), 512, 8192, -1 (unlimited)
    • includeThoughts option to include reasoning in responses
  • New Exports:

    • ThinkingLevel enum for type-safe thinkingLevel values
    • ThinkingConfigInput type for TypeScript users

Installation

npm install ai-sdk-provider-gemini-cli@beta ai@beta

Example Usage

import { createGeminiProvider, ThinkingLevel } from 'ai-sdk-provider-gemini-cli';

const gemini = createGeminiProvider();

// Using string (case-insensitive)
const result = await generateText({
  model: gemini('gemini-3-flash-preview'),
  prompt: 'Solve this complex problem...',
  thinkingConfig: {
    thinkingLevel: 'high',
    includeThoughts: true,
  },
});

// Or using enum
const result = await generateText({
  model: gemini('gemini-3-flash-preview'),
  prompt: 'Solve this complex problem...',
  thinkingConfig: {
    thinkingLevel: ThinkingLevel.HIGH,
  },
});

Technical Details

  • All 191 tests passing
  • Call-time thinkingConfig merges with model-level settings (field-by-field override)

See CHANGELOG.md for full details.

v1.5.1 - thinkingConfig support for Gemini 3

18 Dec 02:03
4763a1e

Choose a tag to compare

Added

  • Thinking Mode Support: Added thinkingConfig settings for Gemini reasoning capabilities (#29)

    • thinkingLevel for Gemini 3 models:
      • low - Minimizes latency and cost (Pro & Flash)
      • medium - Balanced thinking (Flash only)
      • high - Maximizes reasoning depth (Pro & Flash)
      • minimal - Matches "no thinking" for most queries (Flash only)
    • Case-insensitive string input ('HIGH', 'high', 'High' all work)
    • Also accepts ThinkingLevel enum for type-safe usage
    • thinkingBudget for Gemini 2.5 models (backwards compatible)
      • Token-based control: 0 (disabled), 512, 8192 (default), -1 (unlimited)
    • includeThoughts option to include reasoning in responses
    • Re-exported ThinkingLevel enum and ThinkingConfigInput type
  • Known Limitations Documentation: Added comprehensive guide for Gemini API schema complexity limits

Fixed

  • thinkingConfig field merging: Call-time thinkingConfig now merges with model-level settings instead of replacing
  • Invalid thinkingLevel fallback: Invalid call-time values now preserve settings defaults instead of silently dropping

Model Compatibility

thinkingLevel gemini-3-pro-preview gemini-3-flash-preview
low
medium
high
minimal

v2.0.0-beta.1 - AI SDK v6 Support

16 Dec 00:27

Choose a tag to compare

Pre-release

AI SDK v6 (Beta) Support

This release adds compatibility with Vercel AI SDK v6 (beta).

Breaking Changes

  • Provider Interface: ProviderV2ProviderV3
  • Language Model: LanguageModelV2LanguageModelV3
  • Specification Version: 'v2''v3'
  • Warning Type: LanguageModelV2CallWarningSharedV3Warning
  • Warning Format: 'unsupported-setting' + 'setting''unsupported' + 'feature'
  • Token Usage: Flat → hierarchical structure
  • Method Rename: textEmbeddingModel()embeddingModel()
  • Tool Result Output: Now uses typed ToolResultOutput union

Installation

npm install ai-sdk-provider-gemini-cli@beta ai@beta

Dependencies

Pinned to exact beta versions for stability:

  • @ai-sdk/provider: 3.0.0-beta.26
  • @ai-sdk/provider-utils: 4.0.0-beta.51
  • ai (devDep): 6.0.0-beta.156

See CHANGELOG.md for full details.

v1.5.0 - Multimodal File Support

12 Dec 05:02
f062b8b

Choose a tag to compare

What's New

This release adds multimodal file support, extending input capabilities beyond images to include PDF documents, audio files, and video files.

Added

  • Multimodal File Support (#27, thanks @kaiinui)

    • PDF documents (application/pdf)
    • Audio files (audio/* - mp3, wav, flac, etc.)
    • Video files (video/* - mp4, webm, mov, etc.)
    • All file types supported by the underlying Gemini API are now accessible
  • New Example: pdf-document-analysis.mjs

    • Demonstrates analyzing SEC 10-Q filings with Gemini
    • Shows executive summary, financial metrics extraction, and risk analysis patterns

Changed

  • Renamed internal mapImagePart to mapFilePart to reflect broader file type support
  • Updated error messages from "image" to "file" terminology for consistency

Technical Details

  • File handling uses the same inlineData format with base64 encoding
  • URL-based files remain unsupported (base64-encoded data required)
  • All 178 tests passing

Full Changelog: v1.4.1...v1.5.0

v1.4.1

11 Dec 02:25
c52bf90

Choose a tag to compare

Changes

Dependencies

  • Update @google/gemini-cli-core from 0.17.1 to 0.20.0
  • Update @google/genai from 1.16.0 to 1.30.0
  • Update @ai-sdk/provider-utils from 3.0.17 to 3.0.18
  • Refresh dev dependencies to latest patch/minor versions

Fixed

  • Config Proxy Compatibility: Added support for new 0.20.0 configuration methods:
    • getContextManager(), getGlobalMemory(), getEnvironmentMemory() - JIT context support
    • getHookSystem() - Hook execution system
    • getModelAvailabilityService() - Policy-driven model routing
    • getShellToolInactivityTimeout() - Shell command timeout
    • getExperimentsAsync() - Experimental features
  • Proxy Handler: Enhanced fallback handling for Manager, Memory, and Timeout method patterns
  • Security: Fixed high severity vulnerability in jws dependency

Testing

  • All 175 unit tests passing
  • All 13 integration tests passing
  • 81% code coverage maintained

v1.4.0 - Native Structured Output Support

23 Nov 21:34
1b75218

Choose a tag to compare

Added

  • Native Structured Output Support: Implemented native responseJsonSchema support for Gemini API

    • Enables supportsStructuredOutputs = true for improved AI SDK integration
    • Schema is now passed directly to Gemini API via responseJsonSchema in generation config
    • Provides cleaner, more reliable JSON output without post-processing
  • JSON Without Schema Handling: Graceful downgrade when JSON format is requested without a schema

    • Emits unsupported-setting warning to inform users
    • Downgrades to text/plain response format (prevents fenced/raw JSON leaking)
    • Aligns with Claude-code provider behavior for cross-provider consistency
    • Works in both streaming and non-streaming modes

Changed

  • Dependency Updates (aligned with @google/gemini-cli-core 0.17.1):
    • @ai-sdk/provider-utils: 3.0.3 → 3.0.17
    • @google/gemini-cli-core: 0.16.0 → 0.17.1
    • @google/genai: 1.14.0 → 1.16.0 (aligned with gemini-cli-core)
    • google-auth-library: 10.2.1 → ^9.11.0 (aligned with gemini-cli-core)
    • zod-to-json-schema: 3.24.6 → 3.25.0

Removed

  • Prompt-based Schema Injection: Removed workaround that injected schema instructions into user prompts
    • No longer needed with native responseJsonSchema support
  • JSON Extraction Utility: Removed extract-json.ts and related post-processing
    • Gemini now returns clean JSON directly when schema is provided

Technical Details

  • Streaming now outputs JSON chunks directly without accumulation
  • Simplified codebase with shared prepareGenerationConfig helper for consistent behavior
  • Tests updated to use JSON Schema objects instead of Zod schemas (matching what AI SDK passes to providers)
  • All 175 tests passing (including new no-schema downgrade tests)

v1.3.0 - Gemini 3 Support

18 Nov 23:00
c7623e3

Choose a tag to compare

Added

  • Support for Gemini 3: Added support for gemini-3-pro-preview model
  • Dependency Update: Updated @google/gemini-cli-core to 0.16.0 (pinned)
  • Security Updates: Updated dev dependencies (Vite 6, Vitest 4) to resolve security vulnerabilities

Changed

  • Node.js Requirement: Updated engine requirement to node >= 20 to align with @google/gemini-cli-core v0.16.0
  • CI/CD: Removed Node 18 from CI matrix

Fixed

  • Async Configuration: Fixed compatibility with gemini-cli-core v0.16.0 async configuration loading
  • Example Compatibility: Ensured core health-check examples (check-auth.mjs, integration-test.mjs) use GA models (gemini-2.5-pro) for broader compatibility

v1.2.0 - Comprehensive Logging with Verbose Mode

21 Oct 03:08
afa3ee4

Choose a tag to compare

🎉 What's New in v1.2.0

This release adds comprehensive logging capabilities with a flexible verbose mode system, enabling better debugging and production monitoring.

✨ Features

4-Level Logging System

  • debug: Detailed execution tracing (request/response, token usage, timing)
  • info: General flow information (session initialization, completion)
  • warn: Configuration warnings (always shown)
  • error: Error messages (always shown)

Verbose Mode Control

  • Default mode (verbose: false): Silent operation - only warn/error shown
  • Verbose mode (verbose: true): Full debug/info output for development and troubleshooting

Flexible Logger Configuration

  • undefined (default): Console logger with clear level tags ([DEBUG], [INFO], [WARN], [ERROR])
  • false: Completely disabled (noop logger for silent operation)
  • Custom Logger: Integrate with Winston, Pino, Datadog, or any logging system

📝 New Examples

Added 4 comprehensive logging examples:

  • logging-default.mjs - Default silent mode
  • logging-verbose.mjs - Verbose debug mode
  • logging-disabled.mjs - Completely disabled logging
  • logging-custom-logger.mjs - Custom logger integration patterns

🔧 Usage

Silent by Default (Recommended for Production)

import { streamText } from 'ai';
import { createGeminiProvider } from 'ai-sdk-provider-gemini-cli';

const gemini = createGeminiProvider({ authType: 'oauth-personal' });

const result = streamText({ 
  model: gemini('gemini-2.5-pro'), 
  prompt: 'Write a haiku' 
});
// No logs - clean output

Verbose Debug Mode

const result = streamText({ 
  model: gemini('gemini-2.5-pro', { verbose: true }), 
  prompt: 'Write a haiku' 
});
// [DEBUG] Executing generateContent request
// [INFO] Stream completed in 1234ms

Custom Logger Integration

const customLogger = {
  debug: (msg) => winston.debug(msg),
  info: (msg) => winston.info(msg),
  warn: (msg) => winston.warn(msg),
  error: (msg) => winston.error(msg),
};

const result = streamText({ 
  model: gemini('gemini-2.5-pro', { logger: customLogger, verbose: true }), 
  prompt: 'Write a haiku' 
});

Disabled Logging

const result = streamText({ 
  model: gemini('gemini-2.5-pro', { logger: false }), 
  prompt: 'Write a haiku' 
});
// Completely silent - no provider logs at all

⚠️ Breaking Changes

Custom Logger Interface Change

The Logger interface now requires 4 methods instead of 2.

Who is affected: Only users with custom Logger implementations.

Migration Required

// Before (v1.1.2)
const logger = {
  warn: (msg) => myLogger.warn(msg),
  error: (msg) => myLogger.error(msg),
};

// After (v1.2.0)
const logger = {
  debug: (msg) => myLogger.debug(msg), // ✨ Add this
  info: (msg) => myLogger.info(msg),   // ✨ Add this
  warn: (msg) => myLogger.warn(msg),
  error: (msg) => myLogger.error(msg),
};

If you don't have a custom logger, no changes required - the default behavior is unchanged (silent operation).

📦 Installation

npm install ai-sdk-provider-gemini-cli@1.2.0

Or update to latest:

npm install ai-sdk-provider-gemini-cli@latest

🔍 Full Changelog

See CHANGELOG.md for detailed changes.

🎯 Why Version 1.2.0?

This is a minor version bump (not patch) due to the breaking Logger interface change. Following semantic versioning, we use minor versions for backward-incompatible changes that affect a subset of users with a clear migration path.

✅ Quality Assurance

  • 214 tests passing (including 9 new logger tests)
  • Comprehensive Oracle code review completed
  • Zero regressions detected
  • Full documentation and examples provided

Full Changelog: v1.1.2...v1.2.0