from together import Together
import os
client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)
documents = [
{
"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."
}
]
response = client.rerank.create(
model="Salesforce/Llama-Rank-v1",
query="What animals can I find near Peru?",
documents=documents,
)
for result in response.results:
print(f"Rank: {result.index + 1}")
print(f"Title: {documents[result.index]['title']}")
print(f"Text: {documents[result.index]['text']}")import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const documents = [{
"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."
}];
const response = await client.rerank.create({
model: "Salesforce/Llama-Rank-v1",
query: "What animals can I find near Peru?",
documents,
});
for (const result of response.results) {
console.log(`Rank: ${result.index + 1}`);
console.log(`Title: ${documents[result.index].title}`);
console.log(`Text: ${documents[result.index].text}`);
}
import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const documents = [{
"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."
}];
const response = await client.rerank.create({
model: "Salesforce/Llama-Rank-v1",
query: "What animals can I find near Peru?",
documents,
});
for (const result of response.results) {
console.log(`Rank: ${result.index + 1}`);
console.log(`Title: ${documents[result.index].title}`);
console.log(`Text: ${documents[result.index].text}`);
}
curl -X POST "https://api.together.ai/v1/rerank" \
-H "Authorization: Bearer $TOGETHER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Salesforce/Llama-Rank-v1",
"query": "What animals can I find near Peru?",
"documents": [{
"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."
}]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v1/rerank",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'Salesforce/Llama-Rank-V1',
'query' => 'What animals can I find near Peru?',
'documents' => [
[
'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.'
]
],
'top_n' => 2,
'return_documents' => true,
'rank_fields' => [
'title',
'text'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.together.ai/v1/rerank"
payload := strings.NewReader("{\n \"model\": \"Salesforce/Llama-Rank-V1\",\n \"query\": \"What animals can I find near Peru?\",\n \"documents\": [\n {\n \"title\": \"Llama\",\n \"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.\"\n },\n {\n \"title\": \"Panda\",\n \"text\": \"The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China.\"\n },\n {\n \"title\": \"Guanaco\",\n \"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.\"\n },\n {\n \"title\": \"Wild Bactrian camel\",\n \"text\": \"The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia.\"\n }\n ],\n \"top_n\": 2,\n \"return_documents\": true,\n \"rank_fields\": [\n \"title\",\n \"text\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.together.ai/v1/rerank")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"Salesforce/Llama-Rank-V1\",\n \"query\": \"What animals can I find near Peru?\",\n \"documents\": [\n {\n \"title\": \"Llama\",\n \"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.\"\n },\n {\n \"title\": \"Panda\",\n \"text\": \"The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China.\"\n },\n {\n \"title\": \"Guanaco\",\n \"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.\"\n },\n {\n \"title\": \"Wild Bactrian camel\",\n \"text\": \"The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia.\"\n }\n ],\n \"top_n\": 2,\n \"return_documents\": true,\n \"rank_fields\": [\n \"title\",\n \"text\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/rerank")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"Salesforce/Llama-Rank-V1\",\n \"query\": \"What animals can I find near Peru?\",\n \"documents\": [\n {\n \"title\": \"Llama\",\n \"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.\"\n },\n {\n \"title\": \"Panda\",\n \"text\": \"The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China.\"\n },\n {\n \"title\": \"Guanaco\",\n \"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.\"\n },\n {\n \"title\": \"Wild Bactrian camel\",\n \"text\": \"The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia.\"\n }\n ],\n \"top_n\": 2,\n \"return_documents\": true,\n \"rank_fields\": [\n \"title\",\n \"text\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "<unknown>",
"model": "salesforce/turboranker-0.8-3778-6328",
"results": [
{
"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.\"}"
}
}
],
"id": "9dfa1a09-5ebc-4a40-970f-586cb8f4ae47",
"usage": {
"prompt_tokens": 1837,
"completion_tokens": 0,
"total_tokens": 1837
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Create a rerank request
Rerank a list of documents by relevance to a query. Returns a relevance score and ordering index for each document.
from together import Together
import os
client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)
documents = [
{
"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."
}
]
response = client.rerank.create(
model="Salesforce/Llama-Rank-v1",
query="What animals can I find near Peru?",
documents=documents,
)
for result in response.results:
print(f"Rank: {result.index + 1}")
print(f"Title: {documents[result.index]['title']}")
print(f"Text: {documents[result.index]['text']}")import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const documents = [{
"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."
}];
const response = await client.rerank.create({
model: "Salesforce/Llama-Rank-v1",
query: "What animals can I find near Peru?",
documents,
});
for (const result of response.results) {
console.log(`Rank: ${result.index + 1}`);
console.log(`Title: ${documents[result.index].title}`);
console.log(`Text: ${documents[result.index].text}`);
}
import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const documents = [{
"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."
}];
const response = await client.rerank.create({
model: "Salesforce/Llama-Rank-v1",
query: "What animals can I find near Peru?",
documents,
});
for (const result of response.results) {
console.log(`Rank: ${result.index + 1}`);
console.log(`Title: ${documents[result.index].title}`);
console.log(`Text: ${documents[result.index].text}`);
}
curl -X POST "https://api.together.ai/v1/rerank" \
-H "Authorization: Bearer $TOGETHER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Salesforce/Llama-Rank-v1",
"query": "What animals can I find near Peru?",
"documents": [{
"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."
}]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v1/rerank",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'Salesforce/Llama-Rank-V1',
'query' => 'What animals can I find near Peru?',
'documents' => [
[
'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.'
]
],
'top_n' => 2,
'return_documents' => true,
'rank_fields' => [
'title',
'text'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.together.ai/v1/rerank"
payload := strings.NewReader("{\n \"model\": \"Salesforce/Llama-Rank-V1\",\n \"query\": \"What animals can I find near Peru?\",\n \"documents\": [\n {\n \"title\": \"Llama\",\n \"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.\"\n },\n {\n \"title\": \"Panda\",\n \"text\": \"The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China.\"\n },\n {\n \"title\": \"Guanaco\",\n \"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.\"\n },\n {\n \"title\": \"Wild Bactrian camel\",\n \"text\": \"The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia.\"\n }\n ],\n \"top_n\": 2,\n \"return_documents\": true,\n \"rank_fields\": [\n \"title\",\n \"text\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.together.ai/v1/rerank")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"Salesforce/Llama-Rank-V1\",\n \"query\": \"What animals can I find near Peru?\",\n \"documents\": [\n {\n \"title\": \"Llama\",\n \"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.\"\n },\n {\n \"title\": \"Panda\",\n \"text\": \"The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China.\"\n },\n {\n \"title\": \"Guanaco\",\n \"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.\"\n },\n {\n \"title\": \"Wild Bactrian camel\",\n \"text\": \"The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia.\"\n }\n ],\n \"top_n\": 2,\n \"return_documents\": true,\n \"rank_fields\": [\n \"title\",\n \"text\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/rerank")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"Salesforce/Llama-Rank-V1\",\n \"query\": \"What animals can I find near Peru?\",\n \"documents\": [\n {\n \"title\": \"Llama\",\n \"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.\"\n },\n {\n \"title\": \"Panda\",\n \"text\": \"The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China.\"\n },\n {\n \"title\": \"Guanaco\",\n \"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.\"\n },\n {\n \"title\": \"Wild Bactrian camel\",\n \"text\": \"The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia.\"\n }\n ],\n \"top_n\": 2,\n \"return_documents\": true,\n \"rank_fields\": [\n \"title\",\n \"text\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "<unknown>",
"model": "salesforce/turboranker-0.8-3778-6328",
"results": [
{
"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.\"}"
}
}
],
"id": "9dfa1a09-5ebc-4a40-970f-586cb8f4ae47",
"usage": {
"prompt_tokens": 1837,
"completion_tokens": 0,
"total_tokens": 1837
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The model to be used for the rerank request.
See all of Together AI's rerank models
Salesforce/Llama-Rank-v1 "Salesforce/Llama-Rank-V1"
The search query to be used for ranking.
"What animals can I find near Peru?"
List of documents, which can be either strings or objects.
[
{
"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.
2
Whether to return supplied documents with the response.
true
List of keys in the JSON Object document to rank by. Defaults to use all supplied keys for ranking.
["title", "text"]
Response
200
The object type, which is always rerank.
The model to be used for the rerank request.
"salesforce/turboranker-0.8-3778-6328"
Show child attributes
Show child attributes
[
{
"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
"9dfa1a09-5ebc-4a40-970f-586cb8f4ae47"
Show child attributes
Show child attributes
{
"prompt_tokens": 1837,
"completion_tokens": 0,
"total_tokens": 1837
}
Was this page helpful?