Get Answer With Quote
curl --request POST \
--url https://api.example.com/query/answer-with-quote \
--header 'Content-Type: application/json' \
--cookie fastapiusersauth= \
--data '
{
"messages": [
{
"message": "<string>",
"sender": "<string>",
"role": "user"
}
],
"persona_id": 123,
"prompt_id": 123,
"retrieval_options": {
"run_search": "always",
"real_time": true,
"filters": {
"source_type": [],
"document_set": [
"<string>"
],
"time_cutoff": "2023-11-07T05:31:56Z",
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
]
},
"enable_auto_detect_filters": true,
"offset": 123,
"limit": 123
},
"chain_of_thought": false,
"return_contexts": false
}
'import requests
url = "https://api.example.com/query/answer-with-quote"
payload = {
"messages": [
{
"message": "<string>",
"sender": "<string>",
"role": "user"
}
],
"persona_id": 123,
"prompt_id": 123,
"retrieval_options": {
"run_search": "always",
"real_time": True,
"filters": {
"source_type": [],
"document_set": ["<string>"],
"time_cutoff": "2023-11-07T05:31:56Z",
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
]
},
"enable_auto_detect_filters": True,
"offset": 123,
"limit": 123
},
"chain_of_thought": False,
"return_contexts": False
}
headers = {
"cookie": "fastapiusersauth=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'fastapiusersauth=', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [{message: '<string>', sender: '<string>', role: 'user'}],
persona_id: 123,
prompt_id: 123,
retrieval_options: {
run_search: 'always',
real_time: true,
filters: {
source_type: [],
document_set: ['<string>'],
time_cutoff: '2023-11-07T05:31:56Z',
tags: [{tag_key: '<string>', tag_value: '<string>'}]
},
enable_auto_detect_filters: true,
offset: 123,
limit: 123
},
chain_of_thought: false,
return_contexts: false
})
};
fetch('https://api.example.com/query/answer-with-quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/query/answer-with-quote",
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([
'messages' => [
[
'message' => '<string>',
'sender' => '<string>',
'role' => 'user'
]
],
'persona_id' => 123,
'prompt_id' => 123,
'retrieval_options' => [
'run_search' => 'always',
'real_time' => true,
'filters' => [
'source_type' => [
],
'document_set' => [
'<string>'
],
'time_cutoff' => '2023-11-07T05:31:56Z',
'tags' => [
[
'tag_key' => '<string>',
'tag_value' => '<string>'
]
]
],
'enable_auto_detect_filters' => true,
'offset' => 123,
'limit' => 123
],
'chain_of_thought' => false,
'return_contexts' => false
]),
CURLOPT_COOKIE => "fastapiusersauth=",
CURLOPT_HTTPHEADER => [
"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.example.com/query/answer-with-quote"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"message\": \"<string>\",\n \"sender\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"persona_id\": 123,\n \"prompt_id\": 123,\n \"retrieval_options\": {\n \"run_search\": \"always\",\n \"real_time\": true,\n \"filters\": {\n \"source_type\": [],\n \"document_set\": [\n \"<string>\"\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ]\n },\n \"enable_auto_detect_filters\": true,\n \"offset\": 123,\n \"limit\": 123\n },\n \"chain_of_thought\": false,\n \"return_contexts\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "fastapiusersauth=")
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.example.com/query/answer-with-quote")
.header("cookie", "fastapiusersauth=")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"message\": \"<string>\",\n \"sender\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"persona_id\": 123,\n \"prompt_id\": 123,\n \"retrieval_options\": {\n \"run_search\": \"always\",\n \"real_time\": true,\n \"filters\": {\n \"source_type\": [],\n \"document_set\": [\n \"<string>\"\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ]\n },\n \"enable_auto_detect_filters\": true,\n \"offset\": 123,\n \"limit\": 123\n },\n \"chain_of_thought\": false,\n \"return_contexts\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/query/answer-with-quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'fastapiusersauth='
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"message\": \"<string>\",\n \"sender\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"persona_id\": 123,\n \"prompt_id\": 123,\n \"retrieval_options\": {\n \"run_search\": \"always\",\n \"real_time\": true,\n \"filters\": {\n \"source_type\": [],\n \"document_set\": [\n \"<string>\"\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ]\n },\n \"enable_auto_detect_filters\": true,\n \"offset\": 123,\n \"limit\": 123\n },\n \"chain_of_thought\": false,\n \"return_contexts\": false\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"rephrase": "<string>",
"quotes": {
"quotes": [
{
"quote": "<string>",
"document_id": "<string>",
"source_type": "<string>",
"semantic_identifier": "<string>",
"blurb": "<string>",
"link": "<string>"
}
]
},
"citations": [
{
"citation_num": 123,
"document_id": "<string>"
}
],
"docs": {
"top_documents": [
{
"document_id": "<string>",
"chunk_ind": 123,
"semantic_identifier": "<string>",
"blurb": "<string>",
"boost": 123,
"hidden": true,
"metadata": {},
"match_highlights": [
"<string>"
],
"db_doc_id": 123,
"link": "<string>",
"score": 0,
"updated_at": "2023-11-07T05:31:56Z",
"primary_owners": [
"<string>"
],
"secondary_owners": [
"<string>"
]
}
],
"recency_bias_multiplier": 123,
"rephrased_query": "<string>",
"applied_source_filters": [],
"applied_time_cutoff": "2023-11-07T05:31:56Z"
},
"llm_chunks_indices": [
123
],
"error_msg": "<string>",
"answer_valid": true,
"chat_message_id": 123,
"contexts": {
"contexts": [
{
"content": "<string>",
"document_id": "<string>",
"semantic_identifier": "<string>",
"blurb": "<string>"
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Cloud APIs
Answer with Quote
POST
/
query
/
answer-with-quote
Get Answer With Quote
curl --request POST \
--url https://api.example.com/query/answer-with-quote \
--header 'Content-Type: application/json' \
--cookie fastapiusersauth= \
--data '
{
"messages": [
{
"message": "<string>",
"sender": "<string>",
"role": "user"
}
],
"persona_id": 123,
"prompt_id": 123,
"retrieval_options": {
"run_search": "always",
"real_time": true,
"filters": {
"source_type": [],
"document_set": [
"<string>"
],
"time_cutoff": "2023-11-07T05:31:56Z",
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
]
},
"enable_auto_detect_filters": true,
"offset": 123,
"limit": 123
},
"chain_of_thought": false,
"return_contexts": false
}
'import requests
url = "https://api.example.com/query/answer-with-quote"
payload = {
"messages": [
{
"message": "<string>",
"sender": "<string>",
"role": "user"
}
],
"persona_id": 123,
"prompt_id": 123,
"retrieval_options": {
"run_search": "always",
"real_time": True,
"filters": {
"source_type": [],
"document_set": ["<string>"],
"time_cutoff": "2023-11-07T05:31:56Z",
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
]
},
"enable_auto_detect_filters": True,
"offset": 123,
"limit": 123
},
"chain_of_thought": False,
"return_contexts": False
}
headers = {
"cookie": "fastapiusersauth=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'fastapiusersauth=', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [{message: '<string>', sender: '<string>', role: 'user'}],
persona_id: 123,
prompt_id: 123,
retrieval_options: {
run_search: 'always',
real_time: true,
filters: {
source_type: [],
document_set: ['<string>'],
time_cutoff: '2023-11-07T05:31:56Z',
tags: [{tag_key: '<string>', tag_value: '<string>'}]
},
enable_auto_detect_filters: true,
offset: 123,
limit: 123
},
chain_of_thought: false,
return_contexts: false
})
};
fetch('https://api.example.com/query/answer-with-quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/query/answer-with-quote",
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([
'messages' => [
[
'message' => '<string>',
'sender' => '<string>',
'role' => 'user'
]
],
'persona_id' => 123,
'prompt_id' => 123,
'retrieval_options' => [
'run_search' => 'always',
'real_time' => true,
'filters' => [
'source_type' => [
],
'document_set' => [
'<string>'
],
'time_cutoff' => '2023-11-07T05:31:56Z',
'tags' => [
[
'tag_key' => '<string>',
'tag_value' => '<string>'
]
]
],
'enable_auto_detect_filters' => true,
'offset' => 123,
'limit' => 123
],
'chain_of_thought' => false,
'return_contexts' => false
]),
CURLOPT_COOKIE => "fastapiusersauth=",
CURLOPT_HTTPHEADER => [
"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.example.com/query/answer-with-quote"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"message\": \"<string>\",\n \"sender\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"persona_id\": 123,\n \"prompt_id\": 123,\n \"retrieval_options\": {\n \"run_search\": \"always\",\n \"real_time\": true,\n \"filters\": {\n \"source_type\": [],\n \"document_set\": [\n \"<string>\"\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ]\n },\n \"enable_auto_detect_filters\": true,\n \"offset\": 123,\n \"limit\": 123\n },\n \"chain_of_thought\": false,\n \"return_contexts\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "fastapiusersauth=")
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.example.com/query/answer-with-quote")
.header("cookie", "fastapiusersauth=")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"message\": \"<string>\",\n \"sender\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"persona_id\": 123,\n \"prompt_id\": 123,\n \"retrieval_options\": {\n \"run_search\": \"always\",\n \"real_time\": true,\n \"filters\": {\n \"source_type\": [],\n \"document_set\": [\n \"<string>\"\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ]\n },\n \"enable_auto_detect_filters\": true,\n \"offset\": 123,\n \"limit\": 123\n },\n \"chain_of_thought\": false,\n \"return_contexts\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/query/answer-with-quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'fastapiusersauth='
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"message\": \"<string>\",\n \"sender\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"persona_id\": 123,\n \"prompt_id\": 123,\n \"retrieval_options\": {\n \"run_search\": \"always\",\n \"real_time\": true,\n \"filters\": {\n \"source_type\": [],\n \"document_set\": [\n \"<string>\"\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ]\n },\n \"enable_auto_detect_filters\": true,\n \"offset\": 123,\n \"limit\": 123\n },\n \"chain_of_thought\": false,\n \"return_contexts\": false\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"rephrase": "<string>",
"quotes": {
"quotes": [
{
"quote": "<string>",
"document_id": "<string>",
"source_type": "<string>",
"semantic_identifier": "<string>",
"blurb": "<string>",
"link": "<string>"
}
]
},
"citations": [
{
"citation_num": 123,
"document_id": "<string>"
}
],
"docs": {
"top_documents": [
{
"document_id": "<string>",
"chunk_ind": 123,
"semantic_identifier": "<string>",
"blurb": "<string>",
"boost": 123,
"hidden": true,
"metadata": {},
"match_highlights": [
"<string>"
],
"db_doc_id": 123,
"link": "<string>",
"score": 0,
"updated_at": "2023-11-07T05:31:56Z",
"primary_owners": [
"<string>"
],
"secondary_owners": [
"<string>"
]
}
],
"recency_bias_multiplier": 123,
"rephrased_query": "<string>",
"applied_source_filters": [],
"applied_time_cutoff": "2023-11-07T05:31:56Z"
},
"llm_chunks_indices": [
123
],
"error_msg": "<string>",
"answer_valid": true,
"chat_message_id": 123,
"contexts": {
"contexts": [
{
"content": "<string>",
"document_id": "<string>",
"semantic_identifier": "<string>",
"blurb": "<string>"
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I