/** * Google Gemini LLM Provider * * Implements LLMProvider interface for Google Gemini models using * the OpenAI-compatible endpoint for maximum compatibility. * * @example * ```typescript * const provider = createGeminiProvider({ * model: 'gemini-2.0-flash', * apiKey: process.env.GOOGLE_AI_API_KEY * }); * ``` * * @remarks * - Requires valid Google AI API key * - Uses OpenAI-compatible endpoint for streaming and tool calling * - Default model is gemini-2.0-flash * - Extended thinking is not supported (Claude-specific feature) */ import type { ChatOptions } from './types.js'; import { ProviderError } from '../errors.js'; import { OpenAICompatibleProvider } from './openai-compatible.js'; /** * Configuration for GeminiProvider */ export interface GeminiProviderConfig { /** Google AI API key (falls back to GOOGLE_AI_API_KEY or GEMINI_API_KEY env var) */ apiKey?: string; /** Base URL for Gemini API (default: https://generativelanguage.googleapis.com/v1beta/openai) */ baseUrl?: string; /** Default model to use (default: gemini-2.0-flash) */ model?: string; /** Default max tokens (default: 4096) */ maxTokens?: number; /** Request timeout in milliseconds (default: 120000) */ timeout?: number; } /** * Google Gemini LLM Provider * * Provides streaming chat completion using Google's Gemini models * via the OpenAI-compatible API endpoint. * Supports gemini-2.0-flash, gemini-1.5-flash, gemini-1.5-pro, and others. */ export declare class GeminiProvider extends OpenAICompatibleProvider { readonly name = "gemini"; private readonly apiKey; constructor(config?: GeminiProviderConfig); /** * Gemini authentication with Bearer token */ protected getAuthHeaders(): Record; /** * Gemini's OpenAI-compatible endpoint path */ protected getEndpointPath(): string; /** * Gemini uses standard body format (no provider-specific extensions needed) */ protected buildProviderSpecificBody(_options?: ChatOptions): Record; /** * Map HTTP errors with Gemini-specific messages */ protected mapHttpError(status: number, body: string, _model: string): ProviderError; /** * Map connection errors with Gemini-specific messages */ protected mapConnectionError(_error: Error): ProviderError; } /** * Create a Gemini provider instance * * @example * ```typescript * // Using environment variable (GOOGLE_AI_API_KEY or GEMINI_API_KEY) * const provider = createGeminiProvider(); * * // With explicit API key * const provider = createGeminiProvider({ apiKey: 'AI...' }); * * // With custom model * const provider = createGeminiProvider({ model: 'gemini-1.5-pro' }); * * // Available models: * // - gemini-2.0-flash (default, fast) * // - gemini-1.5-flash (faster, cheaper) * // - gemini-1.5-pro (more capable) * ``` */ export declare function createGeminiProvider(config?: GeminiProviderConfig): GeminiProvider;