import { ModelContract } from "../../contracts/model.contract.mjs"; import { RagReranker } from "./reranker.contract.mjs"; //#region ../ai/src/rag/rerank/llm-reranker.d.ts /** Options for the {@link llmReranker}. */ type LlmRerankerOptions = { /** The model used to score candidate relevance. Required. */model: ModelContract; /** * How many candidates to score per model call. Larger batches mean * fewer round-trips but a longer prompt. Default `10`. */ batchSize?: number; }; /** * Optional model-backed reranker. * * Asks an LLM to grade each over-fetched candidate's relevance to the * query on a `0..1` scale, then sorts descending by the model's score. * Candidates the model does not score keep their original cosine score, so * a partial/garbled reply degrades gracefully rather than dropping hits. * Scoring is batched (`batchSize`) to bound prompt length. * * Unlike {@link keywordReranker}, this costs one or more model calls per * retrieval — opt in only when precision matters more than latency/cost. * * @example * const kb = ai.rag({ * embedder, * store, * reranker: ai.rag.llmReranker({ model: openai.model({ name: "gpt-4o-mini" }) }), * }); */ declare function llmReranker(options: LlmRerankerOptions): RagReranker; //#endregion export { LlmRerankerOptions, llmReranker }; //# sourceMappingURL=llm-reranker.d.mts.map