import type { LanguageModel } from "../types.js"; /** Constructor settings forwarded to a dynamically loaded LangChain model. */ export interface LLMConfig { /** Provider API key. When omitted, the provider environment variable is used. */ apiKey?: string; /** Sampling temperature. */ temperature?: number; /** Maximum number of output tokens. */ maxTokens?: number; /** Nucleus sampling probability. */ topP?: number; /** Additional provider-specific constructor settings. */ [key: string]: any; } /** LangChain providers supported by {@link createLLMFromString}. */ export type LLMProvider = "openai" | "anthropic" | "google" | "groq"; /** Parsed components of a LangChain model identifier. */ export interface ParsedLLMString { /** Normalized provider name. */ provider: LLMProvider; /** Provider-specific model name. */ model: string; } /** * Parses an LLM identifier in `"provider/model"` format. * * @param llmString - Provider and model separated by one slash. * @returns The normalized provider and model. * @throws Error if the format is invalid or the provider is unsupported. */ export declare function parseLLMString(llmString: string): ParsedLLMString; /** * Dynamically imports and instantiates a LangChain chat model. * * @param llmString - LLM specification in format "provider/model" (e.g., "openai/gpt-4") * @param config - Optional configuration for the LLM (apiKey, temperature, etc.) * @returns The instantiated LangChain model. * @throws Error if credentials are unavailable, the provider package is not * installed, or the model cannot be constructed. * * @example * ```ts * const llm = await createLLMFromString('openai/gpt-4', { temperature: 0.7 }); * ``` * * @example * ```ts * const llm = await createLLMFromString('anthropic/claude-sonnet-4-6'); * ``` */ export declare function createLLMFromString(llmString: string, config?: LLMConfig): Promise; /** * Tests whether an LLM identifier has a supported provider and valid format. * * @param llmString - Candidate `"provider/model"` identifier. * @returns `true` when {@link parseLLMString} accepts the identifier. */ export declare function isValidLLMString(llmString: string): boolean; /** @returns A new array containing every supported LangChain provider. */ export declare function getSupportedProviders(): LLMProvider[]; //# sourceMappingURL=llm_provider.d.ts.map