/** * LLM Client for Wiki Generation * * OpenAI-compatible API client using native fetch. * Supports OpenAI, Azure, LiteLLM, Ollama, and any OpenAI-compatible endpoint. * * Config priority: CLI flags > env vars > defaults */ export interface LLMConfig { apiKey: string; baseUrl: string; model: string; maxTokens: number; temperature: number; } export interface LLMResponse { content: string; promptTokens?: number; completionTokens?: number; } /** * Resolve LLM configuration from env vars, saved config, and optional overrides. * Priority: overrides (CLI flags) > env vars > ~/.gitnexus/config.json > error * * If no API key is found, returns config with empty apiKey (caller should handle). */ export declare function resolveLLMConfig(overrides?: Partial): Promise; /** * Estimate token count from text (rough heuristic: ~4 chars per token). */ export declare function estimateTokens(text: string): number; export interface CallLLMOptions { onChunk?: (charsReceived: number) => void; } /** * Call an OpenAI-compatible LLM API. * Uses streaming when onChunk callback is provided for real-time progress. * Retries up to 3 times on transient failures (429, 5xx, network errors). */ export declare function callLLM(prompt: string, config: LLMConfig, systemPrompt?: string, options?: CallLLMOptions): Promise;