Web Search Capabilities
Function
Web search.
URI
POST /v1/{project_id}/applications/{application_id}/uni-search/web/search
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 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
repo_id |
Yes |
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. Default value: N/A |
engine |
No |
String |
Definition: Web search engine. Constraints: N/A Value range: N/A Default value: N/A |
mode |
No |
String |
Definition: AI search mode. simple: simple mode. Only one round of search and Q&A is performed. The expected time to first token (TTFT) is 2 seconds. Constraints: N/A Value range: N/A Default value: N/A |
stream |
No |
Boolean |
Definition: Streaming output switch. Constraints: N/A Value range: N/A Default value: N/A |
model_options |
No |
Map<String,Object> |
Definition: Parameters of the generative model. Constraints: N/A Value range: N/A Default value: N/A |
max_documents |
No |
Integer |
Definition: Maximum number of web pages to be retrieved. This is used to control the context of the generated model. Constraints: N/A Value range: 1-20 Default value: 5 |
max_chunk_size |
No |
Integer |
Definition: Maximum size of a web page fragment. For a long web page, internal fragment selection is preferred. Constraints: N/A Value range: 200-2000 Default value: 500 |
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 |
extra_repo_ids |
No |
Array of strings |
Definition: ID of the common search knowledge base. 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: N/A Default value: N/A |
search_enabled |
No |
Boolean |
Definition: Online search. Constraints: N/A Value range: N/A Default value: N/A |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
query |
String |
Definition: User question. N/A Value range: N/A |
documents |
Array of Document objects |
Definition: Web search result. N/A Value range: N/A |
time_travel |
TimeTravel object |
Definition: Debugging information. 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 |
score |
Float |
Definition: Relevance. 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 |
category |
String |
Definition: Directory, single value. Value range: N/A |
tags |
Array of strings |
Definition: Tag list. Value range: N/A |
query |
String |
Definition: Query. Value range: N/A |
type |
String |
Definition: Search type. Value range: N/A |
id |
String |
Definition: ID. Value range: N/A |
file_id |
String |
Definition: File ID. Value range: N/A |
size |
Long |
Definition: Size. Value range: N/A |
has_html |
Boolean |
Definition: Whether HTML is used. Value range: N/A |
rank |
String |
Definition: Ranking of the documents during web search recall. Value range: N/A |
source |
String |
Definition: Source Value range: N/A |
Parameter |
Type |
Description |
---|---|---|
steps |
Array of StepExecution objects |
Definition: Details of each step. Value range: N/A |
elapsed_ms |
Long |
Definition: Elapsed time. The default value is 0. Value range: N/A |
Parameter |
Type |
Description |
---|---|---|
step_name |
String |
Definition: Step name. Value range: N/A |
summary |
String |
Definition: A concise step summary, which is used for process playback and troubleshooting. Value range: N/A |
self_time_ms |
Long |
Definition: Time consumed by the current step. Value range: N/A |
total_time_ms |
Long |
Definition: Total time consumed by the current step. 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
None
Example Responses
None
Status Codes
Status Code |
Description |
---|---|
200 |
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