Get prediction results
import requests
url = "https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}"
response = requests.get(url)
print(response.text)HttpResponse<String> response = Unirest.get("https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}")
.asString();const options = {method: 'GET'};
fetch('https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request GET \
--url https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}{
"predictionId": "b3d4a6f1-8e2c-4a0f-9c73-123456789abc",
"status": "READY",
"predictions": [
{
"tokensUsed": {
"promptTokens": 51,
"completionTokens": 4,
"totalTokens": 55
},
"response": {
"faqPairs": [
{
"question": "What types of accounts are available for travelers looking to manage their finances?",
"answer": "Travelers can choose from various account types such as debit accounts, credit accounts, and travel-specific credit cards, including airline-branded cards that offer travel rewards."
},
{
"question": "What are the eligibility requirements for obtaining a travel-specific credit card?",
"answer": "Eligibility for travel-specific credit cards typically requires a good credit score and a stable income. Specific requirements may vary by issuer."
}
]
}
}
]
}Get prediction results
Fetch the results of a prediction task by its ID.
GET
/
ai
/
async-prediction
/
{PREDICTION_ID}
Get prediction results
import requests
url = "https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}"
response = requests.get(url)
print(response.text)HttpResponse<String> response = Unirest.get("https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}")
.asString();const options = {method: 'GET'};
fetch('https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request GET \
--url https://application_id.applications.lucidworks.com/ai/async-prediction/{PREDICTION_ID}{
"predictionId": "b3d4a6f1-8e2c-4a0f-9c73-123456789abc",
"status": "READY",
"predictions": [
{
"tokensUsed": {
"promptTokens": 51,
"completionTokens": 4,
"totalTokens": 55
},
"response": {
"faqPairs": [
{
"question": "What types of accounts are available for travelers looking to manage their finances?",
"answer": "Travelers can choose from various account types such as debit accounts, credit accounts, and travel-specific credit cards, including airline-branded cards that offer travel rewards."
},
{
"question": "What are the eligibility requirements for obtaining a travel-specific credit card?",
"answer": "Eligibility for travel-specific credit cards typically requires a good credit score and a stable income. Specific requirements may vary by issuer."
}
]
}
}
]
}Was this page helpful?
⌘I