For the complete documentation index, see llms.txt. This page is also available as Markdown.

Rerank

Create Rerank

post
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body

The rerank creation request.

querystring · min: 1Required

The search query to use for the reranking. query and prompt cannot both be provided.

documentsstring[]Required
modelstring · min: 1Required

The model to use for the reranking, call /v1/models endpoint to get the list of available models, only text-classification model type is supported.

top_ninteger · min: 1 · nullableOptional

The number of top results to return. If set to None, all results will be returned.

Other propertiesanyOptional
Responses
200

Successful Response

application/json
objectconst: listOptionalDefault: list
idstringRequired

A unique identifier for the request.

modelstringRequired

The model used to generate the reranking.

Other propertiesanyOptional
post/v1/rerank
POST /v1/rerank HTTP/1.1
Host: albert.api.etalab.gouv.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "query": "text",
  "documents": [
    "text"
  ],
  "model": "text",
  "top_n": 1,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
{
  "object": "list",
  "id": "text",
  "results": [
    {
      "relevance_score": 1,
      "index": 1,
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "model": "text",
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0,
    "cost": 0,
    "impacts": {
      "kWh": 0,
      "kgCO2eq": 0,
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

Last updated

Was this helpful?