Ask Question
curl --request POST \
--url https://api.gbase.ai/v1/question/{ai_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>",
"session_id": "<string>",
"message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"anonymous_username": "",
"use_faq": true,
"max_tokens": 3000,
"stream": true,
"stream_obj": false,
"format": "PLAIN_TEXT",
"with_source": false,
"with_images": true,
"debug_with_messages": false,
"recommend_faq_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": "",
"page_info": {},
"is_test": false,
"metadata": [],
"prompt_custom_goal": "",
"dynamic_background": "",
"language": "<string>",
"agent_mode": "<string>",
"model": "<string>",
"user_identifier": "<string>",
"tool_response": false,
"image_contents": [
{}
]
}
'import requests
url = "https://api.gbase.ai/v1/question/{ai_id}"
payload = {
"question": "<string>",
"session_id": "<string>",
"message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"anonymous_username": "",
"use_faq": True,
"max_tokens": 3000,
"stream": True,
"stream_obj": False,
"format": "PLAIN_TEXT",
"with_source": False,
"with_images": True,
"debug_with_messages": False,
"recommend_faq_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": "",
"page_info": {},
"is_test": False,
"metadata": [],
"prompt_custom_goal": "",
"dynamic_background": "",
"language": "<string>",
"agent_mode": "<string>",
"model": "<string>",
"user_identifier": "<string>",
"tool_response": False,
"image_contents": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
question: '<string>',
session_id: '<string>',
message_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
anonymous_username: '',
use_faq: true,
max_tokens: 3000,
stream: true,
stream_obj: false,
format: 'PLAIN_TEXT',
with_source: false,
with_images: true,
debug_with_messages: false,
recommend_faq_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
created_by: '',
page_info: {},
is_test: false,
metadata: [],
prompt_custom_goal: '',
dynamic_background: '',
language: '<string>',
agent_mode: '<string>',
model: '<string>',
user_identifier: '<string>',
tool_response: false,
image_contents: [{}]
})
};
fetch('https://api.gbase.ai/v1/question/{ai_id}', 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.gbase.ai/v1/question/{ai_id}",
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([
'question' => '<string>',
'session_id' => '<string>',
'message_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'anonymous_username' => '',
'use_faq' => true,
'max_tokens' => 3000,
'stream' => true,
'stream_obj' => false,
'format' => 'PLAIN_TEXT',
'with_source' => false,
'with_images' => true,
'debug_with_messages' => false,
'recommend_faq_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'created_by' => '',
'page_info' => [
],
'is_test' => false,
'metadata' => [
],
'prompt_custom_goal' => '',
'dynamic_background' => '',
'language' => '<string>',
'agent_mode' => '<string>',
'model' => '<string>',
'user_identifier' => '<string>',
'tool_response' => false,
'image_contents' => [
[
]
]
]),
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.gbase.ai/v1/question/{ai_id}"
payload := strings.NewReader("{\n \"question\": \"<string>\",\n \"session_id\": \"<string>\",\n \"message_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"anonymous_username\": \"\",\n \"use_faq\": true,\n \"max_tokens\": 3000,\n \"stream\": true,\n \"stream_obj\": false,\n \"format\": \"PLAIN_TEXT\",\n \"with_source\": false,\n \"with_images\": true,\n \"debug_with_messages\": false,\n \"recommend_faq_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"created_by\": \"\",\n \"page_info\": {},\n \"is_test\": false,\n \"metadata\": [],\n \"prompt_custom_goal\": \"\",\n \"dynamic_background\": \"\",\n \"language\": \"<string>\",\n \"agent_mode\": \"<string>\",\n \"model\": \"<string>\",\n \"user_identifier\": \"<string>\",\n \"tool_response\": false,\n \"image_contents\": [\n {}\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.gbase.ai/v1/question/{ai_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"question\": \"<string>\",\n \"session_id\": \"<string>\",\n \"message_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"anonymous_username\": \"\",\n \"use_faq\": true,\n \"max_tokens\": 3000,\n \"stream\": true,\n \"stream_obj\": false,\n \"format\": \"PLAIN_TEXT\",\n \"with_source\": false,\n \"with_images\": true,\n \"debug_with_messages\": false,\n \"recommend_faq_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"created_by\": \"\",\n \"page_info\": {},\n \"is_test\": false,\n \"metadata\": [],\n \"prompt_custom_goal\": \"\",\n \"dynamic_background\": \"\",\n \"language\": \"<string>\",\n \"agent_mode\": \"<string>\",\n \"model\": \"<string>\",\n \"user_identifier\": \"<string>\",\n \"tool_response\": false,\n \"image_contents\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gbase.ai/v1/question/{ai_id}")
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 \"question\": \"<string>\",\n \"session_id\": \"<string>\",\n \"message_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"anonymous_username\": \"\",\n \"use_faq\": true,\n \"max_tokens\": 3000,\n \"stream\": true,\n \"stream_obj\": false,\n \"format\": \"PLAIN_TEXT\",\n \"with_source\": false,\n \"with_images\": true,\n \"debug_with_messages\": false,\n \"recommend_faq_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"created_by\": \"\",\n \"page_info\": {},\n \"is_test\": false,\n \"metadata\": [],\n \"prompt_custom_goal\": \"\",\n \"dynamic_background\": \"\",\n \"language\": \"<string>\",\n \"agent_mode\": \"<string>\",\n \"model\": \"<string>\",\n \"user_identifier\": \"<string>\",\n \"tool_response\": false,\n \"image_contents\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"messages": [
"<unknown>"
],
"tool_calls": [
"<unknown>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Question
Ask Question
When you upload a file through the file upload interface, you can use this interface to ask questions about the content of the file you upload, and this interface will return the retrieved answer.
POST
/
v1
/
question
/
{ai_id}
Ask Question
curl --request POST \
--url https://api.gbase.ai/v1/question/{ai_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>",
"session_id": "<string>",
"message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"anonymous_username": "",
"use_faq": true,
"max_tokens": 3000,
"stream": true,
"stream_obj": false,
"format": "PLAIN_TEXT",
"with_source": false,
"with_images": true,
"debug_with_messages": false,
"recommend_faq_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": "",
"page_info": {},
"is_test": false,
"metadata": [],
"prompt_custom_goal": "",
"dynamic_background": "",
"language": "<string>",
"agent_mode": "<string>",
"model": "<string>",
"user_identifier": "<string>",
"tool_response": false,
"image_contents": [
{}
]
}
'import requests
url = "https://api.gbase.ai/v1/question/{ai_id}"
payload = {
"question": "<string>",
"session_id": "<string>",
"message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"anonymous_username": "",
"use_faq": True,
"max_tokens": 3000,
"stream": True,
"stream_obj": False,
"format": "PLAIN_TEXT",
"with_source": False,
"with_images": True,
"debug_with_messages": False,
"recommend_faq_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": "",
"page_info": {},
"is_test": False,
"metadata": [],
"prompt_custom_goal": "",
"dynamic_background": "",
"language": "<string>",
"agent_mode": "<string>",
"model": "<string>",
"user_identifier": "<string>",
"tool_response": False,
"image_contents": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
question: '<string>',
session_id: '<string>',
message_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
anonymous_username: '',
use_faq: true,
max_tokens: 3000,
stream: true,
stream_obj: false,
format: 'PLAIN_TEXT',
with_source: false,
with_images: true,
debug_with_messages: false,
recommend_faq_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
created_by: '',
page_info: {},
is_test: false,
metadata: [],
prompt_custom_goal: '',
dynamic_background: '',
language: '<string>',
agent_mode: '<string>',
model: '<string>',
user_identifier: '<string>',
tool_response: false,
image_contents: [{}]
})
};
fetch('https://api.gbase.ai/v1/question/{ai_id}', 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.gbase.ai/v1/question/{ai_id}",
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([
'question' => '<string>',
'session_id' => '<string>',
'message_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'anonymous_username' => '',
'use_faq' => true,
'max_tokens' => 3000,
'stream' => true,
'stream_obj' => false,
'format' => 'PLAIN_TEXT',
'with_source' => false,
'with_images' => true,
'debug_with_messages' => false,
'recommend_faq_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'created_by' => '',
'page_info' => [
],
'is_test' => false,
'metadata' => [
],
'prompt_custom_goal' => '',
'dynamic_background' => '',
'language' => '<string>',
'agent_mode' => '<string>',
'model' => '<string>',
'user_identifier' => '<string>',
'tool_response' => false,
'image_contents' => [
[
]
]
]),
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.gbase.ai/v1/question/{ai_id}"
payload := strings.NewReader("{\n \"question\": \"<string>\",\n \"session_id\": \"<string>\",\n \"message_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"anonymous_username\": \"\",\n \"use_faq\": true,\n \"max_tokens\": 3000,\n \"stream\": true,\n \"stream_obj\": false,\n \"format\": \"PLAIN_TEXT\",\n \"with_source\": false,\n \"with_images\": true,\n \"debug_with_messages\": false,\n \"recommend_faq_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"created_by\": \"\",\n \"page_info\": {},\n \"is_test\": false,\n \"metadata\": [],\n \"prompt_custom_goal\": \"\",\n \"dynamic_background\": \"\",\n \"language\": \"<string>\",\n \"agent_mode\": \"<string>\",\n \"model\": \"<string>\",\n \"user_identifier\": \"<string>\",\n \"tool_response\": false,\n \"image_contents\": [\n {}\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.gbase.ai/v1/question/{ai_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"question\": \"<string>\",\n \"session_id\": \"<string>\",\n \"message_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"anonymous_username\": \"\",\n \"use_faq\": true,\n \"max_tokens\": 3000,\n \"stream\": true,\n \"stream_obj\": false,\n \"format\": \"PLAIN_TEXT\",\n \"with_source\": false,\n \"with_images\": true,\n \"debug_with_messages\": false,\n \"recommend_faq_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"created_by\": \"\",\n \"page_info\": {},\n \"is_test\": false,\n \"metadata\": [],\n \"prompt_custom_goal\": \"\",\n \"dynamic_background\": \"\",\n \"language\": \"<string>\",\n \"agent_mode\": \"<string>\",\n \"model\": \"<string>\",\n \"user_identifier\": \"<string>\",\n \"tool_response\": false,\n \"image_contents\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gbase.ai/v1/question/{ai_id}")
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 \"question\": \"<string>\",\n \"session_id\": \"<string>\",\n \"message_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"anonymous_username\": \"\",\n \"use_faq\": true,\n \"max_tokens\": 3000,\n \"stream\": true,\n \"stream_obj\": false,\n \"format\": \"PLAIN_TEXT\",\n \"with_source\": false,\n \"with_images\": true,\n \"debug_with_messages\": false,\n \"recommend_faq_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"created_by\": \"\",\n \"page_info\": {},\n \"is_test\": false,\n \"metadata\": [],\n \"prompt_custom_goal\": \"\",\n \"dynamic_background\": \"\",\n \"language\": \"<string>\",\n \"agent_mode\": \"<string>\",\n \"model\": \"<string>\",\n \"user_identifier\": \"<string>\",\n \"tool_response\": false,\n \"image_contents\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"messages": [
"<unknown>"
],
"tool_calls": [
"<unknown>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Session ID It is recommended to use uuid
Maximum string length:
100An enumeration.
Available options:
PLAIN_TEXT, JSON_AST, OPENAI_AST Debug only, use debug_with_messages: true, stream: false to get prompt messages
Show child attributes
Show child attributes
custom goal for prompt
Maximum string length:
200JSON string or dict for dynamic background information, used to add to agent meta prompt
多模态图片内容列表,格式: [{'url': 'data:image/png;base64,...', 'detail': 'auto'}]
⌘I