import { AIConfig, ChatCompletionRequestMessage } from "@intlayer/ai";

//#region src/utils/AI/askDocQuestion/askDocQuestion.d.ts
type VectorStoreEl = {
  fileKey: string;
  chunkNumber: number;
  content: string;
  embedding?: number[];
  docUrl: string;
  docName: string;
};
/**
 * Indexes all Markdown documents by generating embeddings for each chunk and storing them in memory.
 * Persists per-document embeddings under `embeddings/<fileKey>.json`.
 * Handles cases where files have been updated and chunk counts have changed.
 */
declare const loadMarkdownFiles: () => Promise<void>;
/**
 * Searches the indexed documents for the most relevant chunks based on a query.
 * Utilizes cosine similarity to find the closest matching embeddings.
 *
 * @param query - The search query provided by the user
 * @returns An array of the top matching document chunks' content
 */
declare const searchChunkReference: (query: string, maxResults?: number, minSimilarity?: number) => Promise<VectorStoreEl[]>;
declare const initPrompt: ChatCompletionRequestMessage;
type AskDocQuestionResult = {
  response: string;
  relatedFiles: string[];
};
type AskDocQuestionOptions = {
  onMessage?: (chunk: string) => void;
};
/**
 * Handles the "Ask a question" endpoint in an Express.js route.
 * Processes user messages, retrieves relevant documents, and interacts with AI models to generate responses.
 *
 * @param messages - An array of chat messages from the user and assistant
 * @returns The assistant's response as a string
 */
declare const askDocQuestion: (messages: ChatCompletionRequestMessage[], aiConfig: AIConfig, options?: AskDocQuestionOptions) => Promise<AskDocQuestionResult>;
//#endregion
export { AskDocQuestionOptions, AskDocQuestionResult, askDocQuestion, initPrompt, loadMarkdownFiles, searchChunkReference };
//# sourceMappingURL=askDocQuestion.d.ts.map