VoyageRerankingOptions type defines the configuration options you can pass when reranking documents using Voyage AI’s reranking models.
Properties
Whether to return the documents in the response.Default:
false- If
false: The API returns a list of{"index", "relevance_score"}where “index” refers to the index of a document within the input list. - If
true: The API returns a list of{"index", "document", "relevance_score"}where “document” is the corresponding document from the input list.
Whether to truncate the input to satisfy the “context length limit” on the query and the documents.Default:
true- If
true: The query and documents are truncated to fit within the context length limit before being processed by the reranker model. - If
false: An error is raised when:- The query exceeds the token limit:
- 8,000 tokens for
rerank-2.5andrerank-2.5-lite - 4,000 tokens for
rerank-2 - 2,000 tokens for
rerank-2-liteandrerank-1 - 1,000 tokens for
rerank-lite-1
- 8,000 tokens for
- The sum of tokens in the query and any single document exceeds:
- 32,000 for
rerank-2.5andrerank-2.5-lite - 16,000 for
rerank-2 - 8,000 for
rerank-2-liteandrerank-1 - 4,000 for
rerank-lite-1
- 32,000 for
- The query exceeds the token limit: