Jiniu AIJiniu AI
Docs
Rerank

Rerank documents

Rerank a list of documents by relevance to the query

POST
/v1/rerank

Request Body

application/json

model*string

Model name; must match the identifier in the model catalog exactly

query*string

Search query

documents*

Documents to rerank

top_n?integer

Return the top N results

return_documents?boolean

Whether to include the original documents in the result

Defaultfalse

Response Body

application/json

curl -X POST "https://jiniu.ai/v1/rerank" \  -H "Content-Type: application/json" \  -d '{    "model": "rerank-english-v2.0",    "query": "string",    "documents": [      "string"    ]  }'
{
  "id": "string",
  "results": [
    {
      "index": 0,
      "relevance_score": 0,
      "document": {}
    }
  ],
  "meta": {}
}