sort_by_relevance
Rerank documents by their relevance to a specific query using the Jina Reranker API. Ideal for document retrieval, content filtering, and identifying the most pertinent information from a collection.
Instructions
Rerank a list of documents by relevance to a query using Jina Reranker API. Use this when you have multiple documents and want to sort them by how well they match a specific query or topic. Perfect for document retrieval, content filtering, or finding the most relevant information from a collection.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
documents | Yes | Array of document texts to rerank by relevance | |
query | Yes | The query or topic to rank documents against (e.g., 'machine learning algorithms', 'climate change solutions') | |
top_n | No | Maximum number of top results to return (default: all documents) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"documents": {
"description": "Array of document texts to rerank by relevance",
"items": {
"type": "string"
},
"type": "array"
},
"query": {
"description": "The query or topic to rank documents against (e.g., 'machine learning algorithms', 'climate change solutions')",
"type": "string"
},
"top_n": {
"description": "Maximum number of top results to return (default: all documents)",
"type": "number"
}
},
"required": [
"query",
"documents"
],
"type": "object"
}