/** * embeddings.ts * * OpenAI text-embedding-3-small client for wiki page vectors. * Used at ingest time (upsertPage) and at query time (hybrid search). * * Cost: $0.020 / 1M tokens (text-embedding-3-small). * Falls back silently when OPENAI_API_KEY is unset so the server * continues to function with FTS-only search. */ export declare const EMBEDDING_MODEL = "text-embedding-3-small"; export declare const EMBEDDING_DIMS = 1536; export declare function isEmbeddingEnabled(): boolean; /** * Generate a single embedding for `text`. * Returns null when OPENAI_API_KEY is unset or the API call fails. * Text is truncated to ~8000 tokens before sending (model max is 8192). */ export declare function generateEmbedding(text: string): Promise; /** * Generate embeddings for a batch of texts. * OpenAI allows up to 2048 inputs per request; callers should chunk larger batches. * Returns an array of the same length; failed entries are null. */ export declare function generateEmbeddings(texts: string[]): Promise>; /** * Build the text to embed for a page: title + summary + (first 2000 chars of content). * Keeping content short reduces token cost while preserving semantic signal. */ export declare function buildEmbeddingInput(title: string, summary: string, content: string): string; //# sourceMappingURL=embeddings.d.ts.map