/** * kosha-discovery — Google / Gemini provider discoverer. * * Queries the Google Generative Language API (`/v1beta/models`) to enumerate * all Gemini models. Unlike most providers, this API is "rich" — it returns * context window sizes (`inputTokenLimit`, `outputTokenLimit`) and supported * generation methods directly, so we can populate those fields without * relying on enrichment. * @module */ import type { CredentialResult, ModelCard } from "../types.js"; import { BaseDiscoverer } from "./base.js"; /** * Discovers models available through the Google Generative Language API. * * Authentication is via an API key passed as a query parameter. * The endpoint uses token-based pagination (`nextPageToken`). */ export declare class GoogleDiscoverer extends BaseDiscoverer { readonly providerId = "google"; readonly providerName = "Google"; readonly baseUrl = "https://generativelanguage.googleapis.com"; /** * Fetch all Gemini models using token-based pagination. * @param credential - Must contain an `apiKey` or `accessToken`. * @param options - Optional timeout override (default 10 s). */ discover(credential: CredentialResult, options?: { timeout?: number; }): Promise; /** * Build the paginated list URL with an optional page token. The API key is * sent via the `x-goog-api-key` header (see {@link discover}), never in the * URL, so it cannot leak through logs or referrers. */ private buildUrl; /** * Convert a Google API model object into a normalized {@link ModelCard}. * * The Google API returns model names prefixed with "models/" (e.g. * "models/gemini-2.5-pro"), so we strip that prefix to get the bare ID. */ private toModelCard; /** * Determine the primary {@link ModelMode} from the model's generation methods. */ private inferMode; /** * Infer capability flags from the model's metadata and ID. * * Gemini Pro, Ultra, and Flash variants support function calling and vision. */ private inferCapabilities; /** * No-key fallback: source the latest public seed via {@link getPublicSeed}, * which uses models.dev as the primary source, fills gaps from the public * LiteLLM catalog, and applies promo overrides. Falls back to the curated * static list only if the public-seed fetch fails or returns no models. */ private publicCatalogFallback; /** Return curated fallback models when both API and public catalog are unavailable. */ private staticFallbackModels; } //# sourceMappingURL=google.d.ts.map