import type { Message, Options, ServiceName, ExtendedResponse, Chunk, SerializedLLM, Model, ConnectionStatus } from './types'; import { BaseProvider } from './providers'; import { type SerializableLLM } from './serializer'; /** * Main LLM class providing unified interface for multiple LLM providers */ export declare class LLM implements SerializableLLM { private messageManager; private abortController; private streamHandler; private defaultOptions; readonly service: ServiceName; readonly model: string; /** * Static parsers for response parsing */ static parsers: { json: (content: string) => T; xml: (content: string) => import("./parsers").XMLNode; codeBlock: (content: string, language?: string) => string; custom: (fn: (content: string) => T) => import("./types").Parser; }; /** * Create a new LLM instance * @param input - Optional initial prompt string or message array * @param options - Configuration options */ constructor(input?: string | Message[], options?: Options); /** * Get the current message history */ get messages(): Message[]; /** * Get the current options */ get options(): Partial; /** * Add a system message to the conversation * @param prompt - The system prompt * @returns This instance for chaining */ system(prompt: string): this; /** * Send a chat message and get a response * @param input - The user message (string or message array) * @param options - Per-request options (merged with instance defaults) */ chat(input: string | Message[], options?: Options): Promise>; /** * Handle non-streaming request */ private handleNonStreamingRequest; /** * Handle streaming request */ private handleStreamingRequest; /** * Build an ExtendedResponse from a provider response */ private buildExtendedResponse; /** * Get the complete response after streaming * @throws Error if called before streaming completes */ complete(): ExtendedResponse; /** * Abort the current request */ abort(): void; /** * Merge per-request options with instance defaults */ private mergeOptions; /** * Validate options */ private validateOptions; /** * Get API key from environment variables */ private getApiKeyFromEnv; /** * Serialize this instance to JSON */ toJSON(): SerializedLLM; /** * Create an LLM instance from serialized JSON */ static fromJSON(data: SerializedLLM): LLM; /** * Fetch available models for a service */ static fetchModels(service: ServiceName, apiKey?: string): Promise; /** * Get quality models (excluding embeddings, TTS, etc.) */ static getQualityModels(service: ServiceName): Model[]; /** * Register a custom service provider */ static registerService(name: string, provider: BaseProvider): void; /** * Verify connection to a service */ static verifyConnection(service: ServiceName, apiKey?: string): Promise; } /** * LLM function interface for one-off requests */ export declare function llm(input: string, options?: Options): Promise>; export default LLM; //# sourceMappingURL=llm.d.ts.map