/**
* @example
* {
* query: "query",
* documents: ["documents"],
* model: "model"
* }
*/
export interface RerankRequest {
/** The query as a string. The query can contain a maximum of 8,000 tokens for `rerank-2.5` and `rerank-2.5-lite`; 4,000 tokens for `rerank-2`; 2,000 tokens for `rerank-2-lite` and `rerank-1`; and 1,000 tokens for `rerank-lite-1`. */
query: string;
/** The documents to be reranked as a list of strings.
- The number of documents cannot exceed 1,000.
- The sum of the number of tokens in the query and the number of tokens in any single document cannot exceed 32,000 for `rerank-2.5` and `rerank-2.5-lite`; 16,000 for `rerank-2`; 8,000 for `rerank-2-lite` and `rerank-1`; and 4,000 for `rerank-lite-1`.
- The total number of tokens, defined as "the number of query tokens × the number of documents + sum of the number of tokens in all documents", cannot exceed 600K for `rerank-2.5`, `rerank-2.5-lite`, `rerank-2` and `rerank-2-lite`; and 300K for `rerank-1` and `rerank-lite-1`. Please see our FAQ.
*/
documents: string[];
/** Name of the model. Recommended options: `rerank-2.5`, `rerank-2.5-lite`. */
model: string;
/** The number of most relevant documents to return. If not specified, the reranking results of all documents will be returned. */
topK?: number;
/** Whether to return the documents in the response. Defaults to `false`. - If `false`, the API will return a list of {"index", "relevance_score"} where "index" refers to the index of a document within the input list.
- If `true`, the API will return a list of {"index", "document", "relevance_score"} where "document" is the corresponding document from the input list.
*/
returnDocuments?: boolean;
/** Whether to truncate the input to satisfy the "context length limit" on the query and the documents. Defaults to `true`. - If `true`, the query and documents will be truncated to fit within the context length limit, before processed by the reranker model.
- If `false`, an error will be raised when the query exceeds 8,000 tokens for `rerank-2.5` and `rerank-2.5-lite`; 4,000 tokens for `rerank-2`; 2,000 tokens for `rerank-2-lite` and `rerank-1`; and 1,000 tokens for `rerank-lite-1`, or the sum of the number of tokens in the query and the number of tokens in any single document exceeds 32,000 for `rerank-2.5` and `rerank-2.5-lite`; 16,000 for `rerank-2`; 8,000 for `rerank-2-lite` and `rerank-1`; and 4,000 for `rerank-lite-1`.
*/
truncation?: boolean;
}