/** * kosha-discovery — OpenAI provider discoverer. * * Queries the OpenAI `/v1/models` endpoint, filters out irrelevant * legacy/fine-tuned models, and maps the rest into {@link ModelCard} objects. * @module */ import type { CredentialResult, ModelCard } from "../types.js"; import { BaseDiscoverer } from "./base.js"; /** * Discovers models available through the OpenAI API. * * The OpenAI list endpoint returns *every* model the key has access to, * including deprecated completions models (babbage, davinci, curie, ada) * and fine-tune snapshots. This discoverer filters those out and keeps * only chat, embedding, image, and audio models. */ export declare class OpenAIDiscoverer extends BaseDiscoverer { readonly providerId = "openai"; readonly providerName = "OpenAI"; readonly baseUrl = "https://api.openai.com"; /** * Fetch the full model list from OpenAI, filter, and normalize. * @param credential - Must contain an `apiKey` or `accessToken`. * @param options - Optional timeout override (default 10 s). */ discover(credential: CredentialResult, options?: { timeout?: number; }): Promise; /** * Determine whether a model ID represents a model we want to track. * * We exclude: * - Fine-tune snapshots (contain "ft:" or ":ft-") * - Legacy completions-only models (babbage, davinci, curie, ada) which * lack chat support and clutter results */ private isRelevantModel; /** Check if the model ID belongs to the chat model family. */ private isChatModel; /** Check if the model ID belongs to the embedding family. */ private isEmbeddingModel; /** Check if the model ID belongs to the image generation family (DALL-E). */ private isImageModel; /** Check if the model ID belongs to the audio family (Whisper / TTS). */ private isAudioModel; /** Convert an OpenAI model object into a normalized {@link ModelCard}. */ private toModelCard; /** Map a model ID to its primary {@link ModelMode}. */ private inferMode; /** * Infer capability flags from the model ID. * * Key design decisions: * - o-series reasoning models (o1, o3, o4) do NOT get "function_calling" * because their reasoning loop does not support tool use in the same way. * - GPT-4o / GPT-4 Turbo get "vision" since they accept image inputs. * - GPT-4o-mini lacks vision but retains function_calling. */ private inferCapabilities; /** * No-key fallback: source the latest merged public seed for this provider * via {@link getPublicSeed}. That seed may combine multiple public inputs * (for example models.dev, LiteLLM, and promo overrides) using the * priority rules defined in `getPublicSeed()`. Falls back to the curated * static list if the public seed fetch fails or yields no models. */ private publicCatalogFallback; /** Return curated fallback models when both API and public catalog are unavailable. */ private staticFallbackModels; } //# sourceMappingURL=openai.d.ts.map