Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
The model to be used for the rerank request.<br> <br> See all of Together AI's rerank models
Available options:
Salesforce/Llama-Rank-v1
Example:
"Salesforce/Llama-Rank-V1"
The search query to be used for ranking.
Example:
"What animals can I find near Peru?"
List of documents, which can be either strings or objects.
Example:
[
{
"title": "Llama",
"text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era."
},
{
"title": "Panda",
"text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China."
},
{
"title": "Guanaco",
"text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations."
},
{
"title": "Wild Bactrian camel",
"text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia."
}
]
The number of top results to return.
Example:
2
Whether to return supplied documents with the response.
Example:
true
List of keys in the JSON Object document to rank by. Defaults to use all supplied keys for ranking.
Example:
["title", "text"]
Response
200
Object type
Available options:
rerank
Example:
"rerank"
The model to be used for the rerank request.
Example:
"salesforce/turboranker-0.8-3778-6328"
Example:
[
{
"index": 0,
"relevance_score": 0.29980177813003117,
"document": {
"text": "{\"title\":\"Llama\",\"text\":\"The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era.\"}"
}
},
{
"index": 2,
"relevance_score": 0.2752447527354349,
"document": {
"text": "{\"title\":\"Guanaco\",\"text\":\"The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations.\"}"
}
}
]
Request ID
Example:
"9dfa1a09-5ebc-4a40-970f-586cb8f4ae47"