Returns an ordered list of documents ordered by their relevance to the provided query.
rerank(
self,
documents: Sequence[str | Document | dict],
query: str,
*,
model: str | None = None,
top_n: int | None = 1,
max_chunks_per_doc: int | None = None
) -> list[dict[str, Any]]| Name | Type | Description |
|---|---|---|
query* | str | The query to use for reranking. |
documents* | Sequence[str | Document | dict] | A sequence of documents to rerank. |
model | str | None | Default: NoneThe model to use for re-ranking. Default to self.model. |
top_n * | unknown | The number of results to return. If |
max_chunks_per_doc * | unknown | The maximum number of chunks derived from a document. |