import { Chat } from "./chat/Chat.js"; import { ChatOptions } from "./chat/ChatOptions.js"; import { Provider, ModelInfo } from "./providers/Provider.js"; import { GeneratedImage } from "./image/GeneratedImage.js"; import { ModelRegistry } from "./models/ModelRegistry.js"; import { PricingRegistry } from "./models/PricingRegistry.js"; import { Transcription } from "./transcription/Transcription.js"; import { Moderation } from "./moderation/Moderation.js"; import { Embedding } from "./embedding/Embedding.js"; import { NodeLLMConfig } from "./config.js"; import { Middleware } from "./types/Middleware.js"; export interface RetryOptions { attempts?: number; delayMs?: number; } type LLMConfig = { provider?: Provider | string; retry?: RetryOptions; middlewares?: Middleware[]; defaultChatModel?: string; defaultTranscriptionModel?: string; defaultModerationModel?: string; defaultEmbeddingModel?: string; } & Omit, "provider">; export declare class NodeLLMCore { readonly config: NodeLLMConfig; readonly provider?: Provider | undefined; readonly retry: Required; readonly middlewares: Middleware[]; private readonly defaults; readonly models: typeof ModelRegistry; readonly pricing: typeof PricingRegistry; constructor(config: NodeLLMConfig, provider?: Provider | undefined, retry?: Required, middlewares?: Middleware[], defaults?: { chat?: string; transcription?: string; moderation?: string; embedding?: string; }); get defaultChatModel(): string | undefined; get defaultTranscriptionModel(): string | undefined; get defaultModerationModel(): string | undefined; get defaultEmbeddingModel(): string | undefined; /** * Returns a scoped LLM instance configured for a specific provider. * This returns a NEW immutable instance. */ withProvider(providerName: string, scopedConfig?: Partial): NodeLLMCore; /** * Register a custom LLM provider. * Note: This modifies the global provider registry. */ registerProvider(name: string, factory: () => Provider): void; getRetryConfig(): Required; private ensureProviderSupport; chat(model?: string, options?: ChatOptions): Chat; listModels(): Promise; paint(prompt: string, options?: { model?: string; images?: string[]; mask?: string; size?: string; quality?: string; n?: number; assumeModelExists?: boolean; requestTimeout?: number; middlewares?: Middleware[]; [key: string]: unknown; }): Promise; transcribe(file: string, options?: { model?: string; prompt?: string; language?: string; speakerNames?: string[]; speakerReferences?: string[]; assumeModelExists?: boolean; requestTimeout?: number; middlewares?: Middleware[]; }): Promise; moderate(input: string | string[], options?: { model?: string; assumeModelExists?: boolean; requestTimeout?: number; middlewares?: Middleware[]; }): Promise; embed(input: string | string[], options?: { model?: string; dimensions?: number; assumeModelExists?: boolean; requestTimeout?: number; middlewares?: Middleware[]; }): Promise; } export { Transcription, Moderation, Embedding, ModelRegistry, PricingRegistry }; /** * Creates a new immutable LLM instance. */ export declare function createLLM(options?: LLMConfig): NodeLLMCore; /** * The global, immutable NodeLLM instance. * * DESIGN: Lazy Initialization * To support 'import "dotenv/config"' patterns in ESM, this instance * does NOT snapshot the environment until its first property access. * Once accessed, it is frozen and becomes a stable, immutable contract. * * @see ARCHITECTURE.md for full contract details */ export declare const NodeLLM: NodeLLMCore; /** * LEGACY BOOTSTRAPPER (DEPRECATED) * * Provided to ease migration from the mutable singleton pattern. * configure() will warn and no-op, as the global instance is now immutable. */ export declare const LegacyNodeLLM: { configure(_options: LLMConfig | ((config: NodeLLMConfig) => void)): void; }; //# sourceMappingURL=llm.d.ts.map