import type { LanguageModel } from "ai"; import type { AiOptions } from "../../types.js"; /** * How the provider factory is constructed from the imported SDK package. * - `cloud-apikey` — `factory({ apiKey })` then `provider(modelId)`. * - `ollama` — `factory({ baseURL })` then `provider(modelId)`. */ export type ProviderKind = "cloud-apikey" | "ollama"; interface ProviderEntry { /** npm package name to dynamically import at runtime. */ pkg: string; /** Named export from the package, e.g. `createAnthropic`. */ factoryName: string; /** Env var that holds the API key. Optional — Ollama has none. */ envVar?: string; /** Default model id when the user does not specify one. */ defaultModel: string; kind: ProviderKind; } /** * Registry of supported AI SDK providers. * * To add a provider: drop a new entry here and publish the corresponding * `@ai-sdk/*` package as an optional peer dep in core's `package.json`. * Users install only the providers they use. */ declare const PROVIDER_REGISTRY: Record; /** Known provider ids plus any user-supplied string (validated at runtime). */ export type ProviderId = keyof typeof PROVIDER_REGISTRY | (string & {}); export interface ResolvedModel { model: LanguageModel; providerId: string; modelId: string; } /** * Best-effort provider auto-detection. * * Resolution order: * 1. First cloud provider (in `CLOUD_DETECT_ORDER`) with its env var set. * 2. Ollama daemon responding at `/` → "ollama". * 3. Otherwise `null`. */ export declare function detectProvider(endpoint?: string): Promise; /** * Resolve an AI SDK `LanguageModel` for the requested (or auto-detected) provider. * * Provider SDKs are loaded lazily via dynamic `import(specifier)` so unused * providers don't need to be installed. If the chosen provider's package is * missing, the error message includes an install hint. */ export declare function createLanguageModel(config: AiOptions): Promise; export {}; //# sourceMappingURL=index.d.ts.map