Obtaining the Knowledge Base List
Function
This API is used to obtain the list of all knowledge bases under the current account. The list includes the knowledge base ID, name, status, creator, creation time, and update time.
URI
GET /v1/{project_id}/applications/{application_id}/uni-search/knowledge-repo
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 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
No |
String |
Definition: Knowledge base name. Constraints: N/A Value range: The value can contain a maximum of 64 characters. It must start with a letter or digit and can contain letters, digits, and underscores (_). Default value: N/A |
status |
No |
String |
Definition: Knowledge base status. Constraints: N/A Value range: The value can be:
Default value: N/A |
page_num |
No |
Integer |
Definition: Page number of the current request, indicating the start page from data retrieval. The default value is 1, indicating to start from the first page. Constraints: N/A Value range: 1-65535 Default value: 1 |
page_size |
No |
Integer |
Definition: Number of records displayed on each page, indicating the number of records returned per request. The default value is 10, indicating that 10 records are displayed on each page. Constraints: N/A Value range: 1-65535 Default value: 10 |
tag |
No |
String |
Definition: Tag information, which consists of key and value connected by colons (:), for example, key1:value1. The tag key and value can each contain a maximum of 128 characters. Therefore, each tag can contain a maximum of 257 characters. Constraints: N/A Value range: 0-257 Default value: N/A |
lod |
No |
String |
Definition: Level of details in the query result returned by the API. You can customize this to return more or less information. Constraints: N/A Value range:
Default value: detail |
create_user |
No |
String |
Definition: Creator. Constraints: N/A Value range: N/A Default value: N/A |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
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 |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
data_list |
Array of KnowledgeRepoDto objects |
Definition: Knowledge base data list. Value range: N/A |
total |
Integer |
Definition: Total number. Value range: N/A |
experimental_features |
Array of strings |
Definition: Experimental feature list. Value range: N/A |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Definition: Knowledge base ID. Value range: N/A |
name |
String |
Definition: Knowledge base name. Value range: N/A |
detail |
String |
Definition: Description. Value range: N/A |
tags |
Array of TagInfo objects |
Definition: Knowledge base tag information. Value range: N/A |
version |
String |
Definition: Knowledge base version information. Value range: N/A |
refs |
String |
Definition: List of referenced knowledge base IDs, which are separated by commas (,). Value range: N/A |
status |
String |
Definition: Status. Value range: N/A |
create_user |
String |
Definition: User. Value range: N/A |
create_time |
String |
Definition: Creation time. Value range: N/A |
update_time |
String |
Definition: Update time. Value range: N/A |
top_k |
Integer |
Definition: The value of top-K, in the range of 10 to 500. Value range: 10-500 |
prompt |
String |
Definition: Prompt information. Value range: The value contains a maximum of 8,192 characters. |
common_prompt |
String |
Definition: General prompt information. Value range: The maximum length is 8,192 characters. |
rerank_enabled |
Boolean |
Definition: Rerank switch. Value range: N/A |
moderate_enabled |
Boolean |
Definition: Whether to enable content moderation. Value range: N/A |
search_plan_enabled |
Boolean |
Definition: Whether to enable the search planning function. Value range: N/A |
query_rewrite_enabled |
Boolean |
Definition: Rewriting switch. Value range: N/A |
reference_count |
Integer |
Definition: The number of reference documents. Number of reference documents provided as input to the NLP model along with the query to generate the final answer. Value range: 1-50 |
fields |
Array of KnowledgeRepoFieldSchema objects |
Definition: Field description. Value range: N/A |
search_threshold |
Float |
Definition: Threshold for filtering search interfaces. Value range: When reranking is disabled, the threshold ranges from 0 to 200. When it is enabled, the threshold ranges from 0 to 1. |
chat_ref_threshold |
Float |
Definition: Reference document filtering threshold. Value range: When reranking is disabled, the threshold ranges from 0 to 200. When it is enabled, the threshold ranges from 0 to 1. |
faq_threshold |
Float |
Definition: FAQs with a correlation score exceeding this threshold will have their answers directly output, without needing to be summarized by the big model. Precautions:
Value range: When reranking is disabled, the threshold ranges from 0 to 200. When it is enabled, the threshold ranges from 0 to 1. |
embedding_model |
String |
Definition: Embedding model name. Value range: N/A |
rerank_model |
String |
Definition: Reranking model name. Value range: N/A |
pangu_nlp_model |
String |
Definition: NLP model name. Value range: N/A |
search_plan_model |
String |
Definition: Name of the search planning model. Value range: N/A |
file_extract |
FileExtract object |
Definition: Document parsing details. Value range: N/A |
search_plan_category_ids |
Array of strings |
Definition: Search planning categories. Value range: The list can contain a maximum of 10 elements. Each element can contain a maximum of 64 characters. Values:
|
language_id |
String |
Definition: Knowledge base language ID Value range: The value can be:
|
cache_enabled |
Boolean |
Definition: Whether to enable cache. Value range: N/A |
session_config |
SessionConfig object |
Definition: Cache policy. Value range: N/A |
answer_reference_enabled |
Boolean |
Definition: Whether to enable the reference function. Value range: N/A |
answer_image_reference_enabled |
Boolean |
Definition: Whether to include both text and images. Value range: N/A |
extend_config |
KnowledgeRepoExtendConfig object |
Definition: Knowledge base extension configuration. Value range: N/A |
prompt_info |
KnowledgeRepoPromptInfo object |
Definition: Associated prompts. Value range: N/A |
actions |
Array of strings |
Definition: Permissions. Value range: N/A |
table_rag_enabled |
Boolean |
Definition: Whether to use tabular enhancement. The prerequisite is that an NL2SQL database has been configured for the current cluster. Value range: false |
Parameter |
Type |
Description |
---|---|---|
tag_key |
String |
Definition: Knowledge base tag keyword. Constraints: N/A Value range: 1 to 128 characters. Default value: N/A |
tag_value |
String |
Definition: Knowledge base tag information. Constraints: N/A Value range: 1 to 128 characters. Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition: Field name. Value range: N/A |
field_type |
String |
Definition: Field type. Value range: N/A |
name_zh |
String |
Definition: Field name (Chinese). Value range: N/A |
Parameter |
Type |
Description |
---|---|---|
parse_conf |
ParseConf object |
Definition: Document parsing configuration, including whether to use OCR enhancement, whether to parse images, whether to extract text during image parsing, whether to parse the header and footer, and whether to parse the contents page. Constraints: N/A Value range: N/A Default value: N/A |
split_conf |
SplitConf object |
Definition: Split configuration, including the segmentation mode, level parsing mode, title level depth, title saving mode, segment length, and title matching pattern. Constraints: N/A Value range: N/A Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
ocr_enabled |
Boolean |
Definition: OCR enhancement. Constraints: N/A Value range: N/A Default value: false |
mllm_enabled |
Boolean |
Definition: Multimodal enhancement. Constraints: N/A Value range: N/A Default value: false |
mllm_model |
String |
Definition: Multimodal 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 32 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. The value must start with a letter or digit. Default value: N/A |
mllm_prompt |
Map<String,String> |
Definition: Prompt of the multimodal model. Constraints: A default prompt is provided. You can also configure custom prompts. Value range: N/A Default value: N/A |
image_enabled |
Boolean |
Definition: Image parsing. Constraints: N/A Value range: N/A Default value: false |
header_footer_enabled |
Boolean |
Definition: Parse the header and footer. Constraints: N/A Value range: N/A Default value: false |
catalog_enabled |
Boolean |
Definition: Parse contents page. Constraints: N/A Value range: N/A Default value: false |
image_conf |
String |
Definition: Image parsing mode when image_enable is set to True. Constraints: When answers need to be returned with images, the IMAGE mode must be used to retain the original images. Value range:
Default value: TEXT |
footnote_enabled |
Boolean |
Definition: Parse footnotes. Constraints: N/A Value range: N/A Default value: false |
Parameter |
Type |
Description |
---|---|---|
split_mode |
String |
Definition: Document segmentation mode. Value range: The value can be:
Constraints: N/A Default value: AUTO |
separator_ids |
Array of strings |
Definition: The chunk ID list in automatic segmentation and length segmentation modes. Chunk ID: determines the end character for each chunk. Constraints: N/A Value range: Value mapping:
Default value: {"period_zh", "period_en", "exclamation_mark_zh", "exclamation_mark_en", "question_mark_zh", "question_mark_en"} |
rule_regex_id |
String |
Definition: User-defined Parsing Rule ID Constraints: N/A Value range: N/A Default value: N/A |
chunk_size |
Integer |
Definition: Maximum length of a document chunk. The document is segmented based on the maximum chunk length. Constraints: N/A Value range: 0-6000 Default value: 500 |
title_level |
Integer |
Definition: Title hierarchy depth retained in a chunk. For example: If the depth is 3 and the current paragraph is 1.1.3, then the parent titles 1.1 and 1 are both retained. If the depth is 2 and the current paragraph is 1.1.3, then the parent title 1.1 is retained, and the parent title 1 is discarded. Constraints: N/A Value range: 1-10 Default value: 3 |
combine_title |
Boolean |
Definition: Whether to retain the hierarchical title combination. Constraints: N/A Value range: N/A Default value: false |
merge_titles |
Boolean |
Definition: Cross-Title Merge: When text in paragraphs with different titles is limited, it is automatically merged up to a specified section length, aiding in the creation of a more comprehensive outcome. Constraints: N/A Value range: N/A Default value: false |
rule_regexs |
Array of strings |
Definition: User-defined parsing rules. Constraints: N/A Value range: The list length ranges from 1 to 100. Default value: N/A |
merge_last_chunk |
Boolean |
Definition: Whether to merge the most recent modified segments. Constraints: N/A Value range: N/A Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
similarity_threshold |
Float |
Definition: Query2query similarity threshold for cache hit. A higher threshold indicates a higher similarity between the new query and the cached query is required. Constraints: N/A Options: 0.1 ~ 1.0 Default value: 0.9 |
answer_select_policy |
String |
Definition: Cache hit selection policy. Constraints: N/A Value range: The value can be:
Default value: N/A |
eviction |
Eviction object |
Definition: Cache expiration policy. Constraints: N/A Value range: N/A Default value: N/A |
model_name |
String |
Definition: Name of the query2query model used to calculate the similarity between the new query and the cached query when there is a hit. Constraints: N/A Value range: 1 to 64 characters. Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
policy |
String |
Definition: Cache expiration policy. Constraints: N/A Value range: The value can be:
Default value: N/A |
ttl |
Long |
Definition: Cache expiration time, in milliseconds. Constraints: N/A Value range: 0-31536000000 Default value: N/A |
hit_count_threshold |
Long |
Definition: Threshold of cache hits. Constraints: N/A Value range: 1-10000 Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
extend_context |
Boolean |
Definition: Extend the context length to generate more comprehensive responses, for example:
Constraints: N/A Value range: N/A Default value: false |
effective_input_length |
Integer |
Definition: Optimal context length, which varies with different models. Set the valid length of input tokens to ensure optimal output. In consideration of multi-turn dialogues, we recommend setting this length to 60/ %(rounded up) of the maximum context length supported by the model. Constraints: N/A Value range: 2-256 Default value: 32 |
top_p |
Float |
Definition: An alternative to sampling with temperature, called nucleus sampling, where the model only takes into account the tokens with the probability mass determined by the top_p parameter. Constraints: N/A Value range: 0.1-1 Default value: 0.1 |
max_tokens |
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: N/A Value range: 1-262144 Default value: 2048 |
chat_temperature |
Float |
Definition: Diversity of non-RAG model's output. Constraints: N/A Value range: N/A Default value: 0-1 |
search_temperature |
Float |
Definition: Diversity of the RAG model's output. Constraints: N/A Value range: 0-1 Default value: 0.6 |
presence_penalty |
Float |
Definition: Text repetition penalty. Constraints: N/A Value range: -2 - 2 Default value: 0 |
use_system_prompt |
Boolean |
Definition: Whether to use system prompts. Keep consistent with the standard prompt assembly solution used by Pangu RAG. Constraints: N/A Value range: N/A Default value: false |
system_prompt |
String |
Definition: System prompt. Note:
Constraints: N/A Value range: 0-8192 Default value: N/A |
qa_question_prompt |
String |
Definition: QA generation and question generation prompt. Constraints: N/A Value range: 0-8192 Default value: N/A |
qa_answer_prompt |
String |
Definition: QA generation and answer generation prompt. Constraints: N/A Value range: N/A Default value: 0-8192 |
refuse_enable |
Boolean |
Definition: Whether to reject certain questions. Constraints: N/A Value range: N/A Default value: false |
refuse_answer |
String |
Definition: Rejection answer. Constraints: N/A Value range: 1-8192 Default value: N/A |
image_match_type |
String |
Definition: Image description parameter. The options are context_match, reference_match, and model_match. The default value is context_match. Constraints: N/A Value range:
Default value: context_match |
custom_types |
Map<String,Map<String,String>> |
Definition: Custom structure type. Constraints: N/A Value range: N/A Default value: N/A |
directory_enable |
Boolean |
Definition: Whether to enable directory management. Constraints: N/A Value range: N/A Default value: false |
embedding_search_enable |
Boolean |
Definition: Whether to enable vector search. Constraints: N/A Value range: N/A Default value: true |
keyword_search_enable |
Boolean |
Definition: Whether to enable keyword-based search. Constraints: N/A Value range: N/A Default value: N/A |
keyword_top_k |
Integer |
Definition: Top-k for keyword-based search. The value ranges from 0 to 100. The default value is 10. Constraints: N/A Value range: 0-100 Default value: 10 |
search_engine_type |
String |
Definition: Search engine type. Constraints: N/A Value range: The value can be:
Default value: N/A |
search_engine_name |
String |
Definition: Search engine name. Constraints: N/A Value range: 0 to 64 characters. Default value: N/A |
think_model_name |
String |
Definition: Name of the deep thinking model. Constraints: N/A Value range: 0 to 64 characters. Default value: N/A |
faq_top_k |
Integer |
Definition: Top-k for Q&A and hybrid search where results are not directly from preset FAQs. Constraints: N/A Value range: 0-50 Default value: 2 |
faq_similarity_threshold |
Float |
Definition: Threshold for Q&A and hybrid search where results are not directly from preset FAQs. Constraints: N/A Value range: 0-1 Default value: 0.8 |
extract_model_name |
String |
Definition: Graph extraction model name. Constraints: N/A Value range: 0 to 64 characters. Default value: N/A |
optimize_model_name |
String |
Definition: Name of the graph optimization model Constraints: N/A Value range: The value cannot exceed 64 characters. Default value: N/A |
graph_search_enable |
Boolean |
Definition: Whether to enable graph search. Constraints: N/A Value range: N/A Default value: false |
graph_reference_count |
Integer |
Definition: Number of graph search reference documents. This parameter takes effect when graph search is enabled. Constraints: N/A Value range: 1-50 Default value: 10 |
graph_top_k |
Integer |
Definition: Top-k for graph vector recall. Constraints: N/A Value range: 1-500 Default value: 50 |
graph_keyword_top_k |
Integer |
Definition: Top-k for keyword-based graph search. Constraints: N/A Value range: 1-100 Default value: 20 |
graph_threshold |
Float |
Definition: Graph re-ranking threshold. Constraints: N/A Value range: 0-200 Default value: 0.3 |
Parameter |
Type |
Description |
---|---|---|
prompt_id |
String |
Definition: Prompt ID. Constraints: N/A Value range: The value can contain only 1 to 64 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. Default value: N/A |
qa_question_prompt_id |
String |
Definition: QA question generation prompt ID. Constraints: N/A Value range: The value can contain only 1 to 64 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. Default value: N/A |
qa_answer_prompt_id |
String |
Definition: QA answer generation prompt ID Constraints: N/A Value range: The value can contain only 1 to 64 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. Default value: N/A |
mllm_prompt_id |
String |
Definition: ID of the mllm prompt. Constraints: N/A Value range: The value can contain only 1 to 64 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. Default value: N/A |
table_rag_config |
String |
Definition: Prompts related to tabular enhancement, including: chat_prompt_with_sqlresults_id: Q&A prompts for tabular enhancement nl2sql_prompt_id: prompt for generating SQL statements table_rag_prompt_id: tabular Q&A prompt Constraints: N/A Value range: 1 to 512 characters. Default value: 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
-
Obtain the list of all knowledge bases that are disabled under the current account.
/v1/1ed40ceefc8d40f8b884edb6a84e7768/applications/fb9731ab-7085-474f-b6c7-64473586f0f3/uni-search/knowledge-repo?page_num=1&page_size=10&lod=simple&status=CLOSE
-
Obtain the list of all knowledge bases under the current account.
/v1/1ed40ceefc8d40f8b884edb6a84e7768/applications/fb9731ab-7085-474f-b6c7-64473586f0f3/uni-search/knowledge-repo?page_num=1&page_size=10&lod=simple
Example Responses
Status code: 200
Knowledge base list response body.
{ "data_list" : [ { "id" : "ceb97941-e11b-42b8-ac69-aa4488f50100", "name" : "test", "detail" : "", "version" : "bcef7793-cbc2-4809-b188-d678111de486", "status" : "OPEN", "create_user" : "admin", "create_time" : "1751507086257", "update_time" : "1751510885800", "top_k" : 50, "rerank_enabled" : true, "moderate_enabled" : false, "query_rewrite_enabled" : true, "table_rag_enabled" : false, "reference_count" : 3, "fields" : [ ], "search_threshold" : 0, "embedding_model" : "pangu_model", "rerank_model" : "rerank_model", "pangu_nlp_model" : "nlp_model", "search_plan_model" : "search_plan_model", "search_plan_category_ids" : [ ], "language_id" : "zh", "cache_enabled" : false, "answer_reference_enabled" : false, "answer_image_reference_enabled" : false, "actions" : [ "knowledge_list", "knowledge_content_list", "knowledge_create_and_delete", "knowledge_content", "knowledge_operations", "knowledge_base", "knowledge_content_management", "knowledge_version_management", "knowledge_config", "knowledge_open_and_close" ], "chat_ref_threshold" : 0, "faq_threshold" : 0.95, "extend_config" : { "extend_context" : false, "effective_input_length" : 20, "top_p" : 0.1, "max_tokens" : 2048, "chat_temperature" : 0.6, "search_temperature" : 0.6, "presence_penalty" : 0, "search_engine_type" : "search_engine", "search_engine_name" : "cjh-test-petal", "think_model_name" : "deepseek-v3-jp", "refuse_enable" : false, "image_match_type" : "context_match", "directory_enable" : false, "embedding_search_enable" : true, "keyword_search_enable" : false, "keyword_top_k" : 10, "faq_top_k" : 2, "faq_similarity_threshold" : 0.8 }, "prompt_info" : { "prompt_id" : "default_chat_prompt", "qa_question_prompt_id" : "default_qa_question_prompt", "qa_answer_prompt_id" : "default_qa_answer_prompt", "table_rag_config" : "{\"chat_prompt_with_sqlresults_id\":\"default_chat_prompt_with_sqlresults\",\"nl2sql_prompt_id\":\"default_nl2sql_prompt\",\"table_rag_prompt_id\":\"default_table_rag_prompt\"}" } } ], "total" : 1, "experimental_features" : [ "enable-ai-search", "exclusive", "enable-region-rac", "enable-permission", "enable-region-ocr" ] }
Status Codes
Status Code |
Description |
---|---|
200 |
Knowledge base list response body. |
400 |
Incorrect request body parameter. |
500 |
Internal 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