Actions6
Rerank → Rerank
AI-generatedSummary
Rerank documents by relevance to a query using a specified model.
Inputs
- Query (required) — The query string to rank documents against.
- Documents (required) — A JSON array of document strings to rerank.
- Model — The reranker model to use (e.g., rerank-multilingual-v3.0).
- Top N — Maximum number of results to return; leave empty to return all.
Output shape
A JSON object containing the query and an array of results. Each result includes the index, relevance score, and the document content.
Results are ordered by relevance score. The operation supports advanced options to store the raw API response in the output JSON or as a binary file.
Examples
Example 1: Rank a list of news articles by relevance to a user query.
Query: 'Latest AI developments'; Documents: JSON array of article titles; Top N: 5
Example 2: Rerank search results for a multilingual query.
Query: 'machine learning'; Documents: JSON array of search snippets; Model: rerank-multilingual-v3.0