/** * Base adapter class for LLM providers * * @packageDocumentation */ import type { LLMProvider, LLMConfig, LLMAdapter, CompletionRequest, CompletionResponse } from '../../types/llm.js'; /** * LLM-related errors */ export declare class LLMError extends Error { readonly code: LLMErrorCode; readonly provider: LLMProvider; readonly cause?: Error | undefined; constructor(message: string, code: LLMErrorCode, provider: LLMProvider, cause?: Error | undefined); } export type LLMErrorCode = 'NOT_CONFIGURED' | 'API_ERROR' | 'RATE_LIMIT' | 'INVALID_RESPONSE' | 'TIMEOUT' | 'NETWORK_ERROR' | 'PARSE_ERROR'; /** * Default configuration values */ export declare const DEFAULT_CONFIG: { maxTokens: number; temperature: number; timeout: number; retries: number; }; /** * Abstract base class for LLM adapters */ export declare abstract class BaseLLMAdapter implements LLMAdapter { protected config: LLMConfig; constructor(config: LLMConfig); abstract get provider(): LLMProvider; get model(): string; abstract complete(request: CompletionRequest): Promise; isConfigured(): boolean; getConfig(): Omit; /** * Retry a function with exponential backoff */ protected withRetry(fn: () => Promise, maxRetries?: number): Promise; /** * Parse JSON from LLM response, handling common issues */ protected parseJSON(content: string): T; } //# sourceMappingURL=base.d.ts.map