Web AI Search Q&A
Function
Web AI Search Q&A
URI
POST /v1/{project_id}/applications/{application_id}/uni-search/web/chat
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. Constraints: N/A Value range: The value can contain 1 to 64 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. The value must start with a letter. Default value: N/A |
|
application_id |
Yes |
String |
Definition: Application ID. For details about how to obtain the application ID, see Obtaining an Application ID. Constraints: Character string Value range: The value can contain 1 to 64 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. The value must start with a letter. Default value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
Token |
No |
String |
Definition: After a user logs in, a token is created for authentication based on the user login information. The user validity is verified through authentication. Constraints: N/A Value range: N/A Default value: N/A |
|
X-Auth-Token |
Yes |
String |
Definition: Token used for API authentication. For details about how to obtain the token, see Obtaining an IAM User Token. Constraints: N/A Value range: N/A Default value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
repo_id |
No |
String |
Definition: Knowledge base ID. Constraints: N/A Value range: The value can contain 1 to 64 characters. It can only contain letters, digits, underscores (_), and hyphens (-). Default value: N/A |
|
chat_id |
No |
String |
Definition: Chat ID. Constraints: N/A Value range: The value can contain 1 to 64 characters. It can only contain letters, digits, underscores (_), and hyphens (-). Default value: N/A |
|
query |
Yes |
String |
Definition: User question. Constraints: N/A Value range: The value cannot be empty. It can contain a maximum of 20,480 characters. Default value: N/A |
|
history |
No |
Array of strings |
Definition: Chat history. Implementation logic:
Constraints:
Value range: The list length cannot exceed 40 characters. Default value: N/A |
|
stream |
No |
Boolean |
Definition: Streaming output switch. Constraints: N/A Value range:
Default value: N/A |
|
prompt_template |
No |
String |
Definition: Prompt template, which provides the query and docs context. Constraints: N/A Value range: N/A Default value: N/A |
|
file_ids |
No |
Array of strings |
Definition: File-based Q&A. Constraints: N/A Value range: N/A Default value: N/A |
|
thinking_enabled |
No |
Boolean |
Definition: Deep thinking. Constraints: N/A Value range:
Default value: false |
|
search_enabled |
No |
Boolean |
Definition: Online search. Constraints: N/A Value range:
Default value: false |
|
model |
No |
String |
Definition: Model name Constraints: The mllm_plan model must have already been configured on the platform. You can check the models configured on the platform using the ListModels API. Value range: The value can contain 1 to 64 characters, including only letters, digits, underscores (_), and hyphens (-). Default value: N/A |
|
max_tokens |
No |
Integer |
Definition: Maximum number of tokens in the generated text. The total length of the input text plus the generated text cannot exceed the maximum length that the model can process. Constraints: Value range: 1 to 131,072 characters Default value: 4096 |
|
chat_temperature |
No |
Float |
Definition: Diversity of non-RAG model's output temperature controls the probability distribution of each candidate word when the text is generated. Constraints: N/A Value range: 0-1 Default value: 0.6 |
|
search_temperature |
No |
Float |
Definition: Diversity of the RAG model's output temperature controls the probability distribution of each candidate word when the text is generated. Constraints: N/A Value range: 0-1 Default value: 0.6 |
|
presence_penalty |
No |
Float |
Definition: Text repetition penalty. Constraints: N/A Value range: -2~2 Default value: 0 |
|
top_p |
No |
Float |
Definition: Probability threshold used by the sampling method during generation Constraints: N/A Value range: 0~1 Default value: 0.1 |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
chat_id |
String |
Definition: Chat ID. |
|
chat_result |
ChatResult object |
Definition: Dialog result. |
|
documents |
Array of Document objects |
Definition: Web search result. |
|
Parameter |
Type |
Description |
|---|---|---|
|
index |
Integer |
Definition: No. Value range: N/A |
|
message |
String |
Definition: Text content. Value range: N/A |
|
question_id |
String |
Definition: Q&A ID. Value range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
title |
String |
Definition: Title. Use this name and URL to create a hyperlink. Clicking the hyperlink will take the user to the web page. Value range: N/A |
|
content |
String |
Definition: Content. Value range: N/A |
|
url |
String |
Definition: Hyperlink. Value range: N/A |
|
timestamp |
String |
Definition: Update time (time when the web page is captured last time). The date format is YYYY-MM-DDTHH:MM:SS. Value range: N/A |
|
site_name |
String |
Definition: Site name Value range: N/A |
|
site_icon |
String |
Definition: Site icon address. Value range: N/A |
|
type |
String |
Definition: Search type. Value range: N/A |
|
id |
String |
Definition: ID. Value range: N/A |
|
size |
Long |
Definition: Size. Value range: N/A |
|
has_html |
Boolean |
Definition: Whether HTML is used. Value range:
|
|
source |
String |
Definition: Source Value range: N/A |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition: Value range: N/A |
|
error_msg |
String |
Definition: Error message. Value range: N/A |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition: Value range: N/A |
|
error_msg |
String |
Definition: Error message. Value range: N/A |
Example Requests
Web AI search Q&A.
/v1/b25446daeb1a41a7953c5deba2b2677a/applications/be9b19bf-4865-4fb8-b9f8-2fd1fea98d76/uni-search/web/chat
{
"repo_id" : "0c3fae2d-428e-454c-ad80-2e5c5fa7b33a",
"query" : "Today's weather",
"chat_id" : "e561df11-50ba-42f0-a7fe-9bdb0e17be85",
"file_ids" : [ ],
"history" : [ ],
"stream" : false,
"thinking_enabled" : false,
"search_enabled" : false
}
Example Responses
Status code: 200
AI search response.
{
"chat_id" : "3be7ea6b-2eb4-4a87-80cd-a519ff61b701",
"chat_result" : {
"index" : 0,
"message" : "\"Shishenghua\" generally refers to **Lithops**, a succulent plant that looks like a small stone and is native to the arid regions of southern Africa. Its most notable feature is its ability to \"camouflage as a stone\" to avoid being eaten by animals, which is how it got its name. Here are its core characteristics:\n\n---\n\n### 1. Looks like a stone, but can bloom!\n- **Appearance**: Two thick leaves form a \"pebble\" shape, with spots, patterns, or color changes on the surface, perfectly mimicking the surrounding rocks.\n- **Flowering**: In autumn, daisy-like flowers (yellow, white, pink) emerge from the cracks between the leaves, earning it the nickname \"flowers that bloom from stones.\"\n\n---\n\n### 2. Top survival skills!\n- **Master of mimicry**: Camouflages as a stone to avoid animals and can even change its surface color to match the environment.\n- **Extremely drought-resistant**: Native to deserts, its leaves store water, allowing it to survive for months without watering.\n- **Sensitive to water and humidity**: Overwatering can lead to root rot, so the soil must be well-draining (sandy soil is best).\n\n---\n\n### 3. Care tips: a blessing for the lazy, but don't be careless!\n- **Water sparingly**: Water thoroughly when the soil is completely dry in spring and autumn, and almost stop watering in summer and winter (during dormancy).\n- **Lots of sunlight**: Needs plenty of sunlight, but avoid direct exposure in summer.\n- **Don't touch**: The \"windows\" (transparent spots) on the leaves are its organs for absorbing sunlight, and excessive touching can damage them.\n\n---\n\n### Interesting facts\n- Nickname: \"Butt Flower\": The two leaves are round and similar to the buttocks. The English name Lithops is directly translated as \"stone face.\"\n- Long lifespan: A single plant can live for decades, but it grows very slowly, only a few millimeters a year.\n\nIf you want to grow it, remember that it **fears water > fears drought > fears darkness**. Just control your hand and don't water it randomly, and it will live!",
"question_id" : "58ea9958-23c9-4b96-967a-6b7921497011"
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
AI search response. |
|
400 |
Client error. |
|
500 |
Server error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot