/** * Chat Completion — pluggable chat/completion provider for the Graphile LLM plugin * * Provides a provider-based architecture for LLM chat completions. * Currently supports Ollama via @agentic-kit/ollama. * * Used by the RAG plugin to generate answers from retrieved context. * * Resolution order mirrors the embedder: * 1. The `llm_module` configuration (per-database) * 2. The preset's `defaultChatCompleter` option (fallback for dev/testing) * 3. Environment variables (CHAT_PROVIDER, CHAT_MODEL, CHAT_BASE_URL) */ import type { ChatConfig, ChatFunction, LlmModuleData } from './types'; /** * Build a chat completion function from a config object. * * @returns A ChatFunction, or null if the provider is not recognized */ export declare function buildChatCompleter(config: ChatConfig): ChatFunction | null; /** * Build a chat completer from an `llm_module` row. * * @param data - The llm_module data from metaschema_modules_public.llm_module * @returns A ChatFunction, or null if the chat provider is not configured */ export declare function buildChatCompleterFromModule(data: LlmModuleData): ChatFunction | null; /** * Resolve a chat completer from environment variables. * This is a fallback for development when no llm_module or defaultChatCompleter is configured. * * Environment variables (with defaults from env.ts): * CHAT_PROVIDER - Provider name (default: 'ollama') * CHAT_MODEL - Model identifier (default: 'llama3') * CHAT_BASE_URL - Provider base URL (default: 'http://localhost:11434') */ export declare function buildChatCompleterFromEnv(): ChatFunction | null;