Handle Simplified Chat Message
curl --request POST \
--url https://api.example.com/chat/send-message-simple-api \
--header 'Content-Type: application/json' \
--cookie fastapiusersauth= \
--data '
{
"chat_session_id": 123,
"message": "<string>",
"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
},
"query_override": "<string>",
"search_doc_ids": [
123
]
}
'import requests
url = "https://api.example.com/chat/send-message-simple-api"
payload = {
"chat_session_id": 123,
"message": "<string>",
"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
},
"query_override": "<string>",
"search_doc_ids": [123]
}
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({
chat_session_id: 123,
message: '<string>',
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
},
query_override: '<string>',
search_doc_ids: [123]
})
};
fetch('https://api.example.com/chat/send-message-simple-api', 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/chat/send-message-simple-api",
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([
'chat_session_id' => 123,
'message' => '<string>',
'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
],
'query_override' => '<string>',
'search_doc_ids' => [
123
]
]),
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/chat/send-message-simple-api"
payload := strings.NewReader("{\n \"chat_session_id\": 123,\n \"message\": \"<string>\",\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 \"query_override\": \"<string>\",\n \"search_doc_ids\": [\n 123\n ]\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/chat/send-message-simple-api")
.header("cookie", "fastapiusersauth=")
.header("Content-Type", "application/json")
.body("{\n \"chat_session_id\": 123,\n \"message\": \"<string>\",\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 \"query_override\": \"<string>\",\n \"search_doc_ids\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/chat/send-message-simple-api")
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 \"chat_session_id\": 123,\n \"message\": \"<string>\",\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 \"query_override\": \"<string>\",\n \"search_doc_ids\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"answer_citationless": "<string>",
"simple_search_docs": [
{
"semantic_identifier": "<string>",
"blurb": "<string>",
"match_highlights": [
"<string>"
],
"link": "<string>"
}
],
"error_msg": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Cloud APIs
Answer with Citations
This is a Non-Streaming version that only gives back a minimal set of information
POST
/
chat
/
send-message-simple-api
Handle Simplified Chat Message
curl --request POST \
--url https://api.example.com/chat/send-message-simple-api \
--header 'Content-Type: application/json' \
--cookie fastapiusersauth= \
--data '
{
"chat_session_id": 123,
"message": "<string>",
"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
},
"query_override": "<string>",
"search_doc_ids": [
123
]
}
'import requests
url = "https://api.example.com/chat/send-message-simple-api"
payload = {
"chat_session_id": 123,
"message": "<string>",
"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
},
"query_override": "<string>",
"search_doc_ids": [123]
}
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({
chat_session_id: 123,
message: '<string>',
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
},
query_override: '<string>',
search_doc_ids: [123]
})
};
fetch('https://api.example.com/chat/send-message-simple-api', 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/chat/send-message-simple-api",
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([
'chat_session_id' => 123,
'message' => '<string>',
'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
],
'query_override' => '<string>',
'search_doc_ids' => [
123
]
]),
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/chat/send-message-simple-api"
payload := strings.NewReader("{\n \"chat_session_id\": 123,\n \"message\": \"<string>\",\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 \"query_override\": \"<string>\",\n \"search_doc_ids\": [\n 123\n ]\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/chat/send-message-simple-api")
.header("cookie", "fastapiusersauth=")
.header("Content-Type", "application/json")
.body("{\n \"chat_session_id\": 123,\n \"message\": \"<string>\",\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 \"query_override\": \"<string>\",\n \"search_doc_ids\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/chat/send-message-simple-api")
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 \"chat_session_id\": 123,\n \"message\": \"<string>\",\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 \"query_override\": \"<string>\",\n \"search_doc_ids\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"answer_citationless": "<string>",
"simple_search_docs": [
{
"semantic_identifier": "<string>",
"blurb": "<string>",
"match_highlights": [
"<string>"
],
"link": "<string>"
}
],
"error_msg": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
Before creating messages, be sure to create a chat_session and get an id Note, for simplicity this option only allows for a single linear chain of messages
Was this page helpful?
⌘I