LLMReranker
Reranker that uses a language model to judge relevance.
Each candidate document is presented to the LLM alongside the query. The LLM scores each candidate on a 0-10 scale and optionally provides a reason for the score. Results are reordered by LLM-assigned score.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LLMReranker(options): LLMReranker;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”LLMReranker
Methods
Section titled “Methods”rerank()
Section titled “rerank()”rerank( query, results,options?): Promise<RetrievalResult[]>;Rerank retrieval results by relevance to the query.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<RetrievalResult[]>