Rerank
The rerank creation request.
The search query to use for the reranking. query and prompt cannot both be provided.
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.
The number of top results to return. If set to None, all results will be returned.
Successful Response
listA unique identifier for the request.
The model used to generate the reranking.
Insufficient budget.
Invalid authentication scheme.
Invalid API key.
Your account has expired. Please contact support to renew your account.
Model {name} not found.
Model has wrong type. Expected: {expected_type}. Actual: {actual_type}.
Token/request limit per minute/day exceeded.
Model is too busy, please try again later.
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?