ListIndices
Retrieves the list of knowledge bases in a specified workspace.
Operation description
- Resource Access Management (RAM) users must first obtain API permissions for Alibaba Cloud Model Studio (requires
AliyunBailianDataFullAccess, which includes the sfm:ListIndex permission) before calling this operation. Alibaba Cloud accounts can call this operation directly without authorization. Use the latest Alibaba Cloud Model Studio SDK to call this operation. - This operation is idempotent.
Rate limit: This operation is throttled if called too frequently. Do not exceed 10 calls per second. If throttled, retry later.
Try it now
You can call this operation directly in OpenAPI Explorer, eliminating the need to calculate signatures. After the call succeeds, OpenAPI Explorer can automatically generate SDK code examples.
RAM authorization
The following table describes the authorization information of this API. You can use it in the Action element of a RAM permission policy statement to grant RAM users or RAM roles the permission to call this API. The details are as follows:
-
Operation: refers to the specific permission.
-
Access level: refers to the access level of each operation. Valid values: Write, Read, or List.
-
Resource type: refers to the resource types that support authorization in the operation. For more information:
- For required resource types, an asterisk (*) is added in front.
- For operations that do not support resource-level authorization,
All Resourcesis used.
-
Condition key: refers to the condition keys defined by the cloud service itself.
-
Dependent operation: refers to other permissions required to successfully perform the operation. The caller must have the permissions of the dependent actions at the same time for the operation to succeed.
Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
sfm:ListIndex | list | *All Resources
| None | None |
Request syntax
GET /{WorkspaceId}/index/list_indices HTTP/1.1
Path Parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The ID of the workspace to which the knowledge base belongs. For more information, see How to use a workspace. | llm-3shx2gu255oq6xxxx |
Request parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| IndexName | string | No | The name of the knowledge base. You can use this parameter to search for a knowledge base by name. The name must be 1 to 20 characters in length and can contain characters classified as letters in Unicode (including English letters, Chinese characters, and digits). The name can also contain colons (:), underscores (_), periods (.), or hyphens (-). Default value: empty, which queries all knowledge bases in the specified workspace. | idx_status_score |
| PageNumber | string | No | The page number. Minimum value: 1. Default value: 1. | 1 |
| PageSize | string | No | The number of knowledge bases to display per page in a paging query. No maximum limit. Default value: 10. | 10 |
Response elements
Element | Type | Description | Example |
|---|---|---|---|
object | Schema of Response | ||
| RequestId | string | The request ID. | 17204B98-xxxx-4F9A-8464-2446A84821CA |
| Data | object | The returned data. | |
| PageNumber | integer | The page number returned. | 1 |
| PageSize | integer | The number of entries per page returned. | 10 |
| TotalCount | integer | The total number of entries returned. | 48 |
| Indices | array<object> | The list of knowledge bases. | |
object | The knowledge base object. | ||
| Id | string | The ID of the knowledge base, which is the | lecxr5xxxx |
| Name | string | The name of the knowledge base. | XXXX Product List |
| Description | string | The description of the knowledge base. | The products in the list mainly target overseas customers. |
| StructureType | string | The type of the knowledge base. Valid values:
| UNSTRUCTURED |
| ChunkSize | integer | The estimated length of chunks. Valid values: [1-2048]. | 5 |
| OverlapSize | integer | The overlap length. Valid values: [0-1024]. | 10 |
| Separator | string | The clause identifier. Separate multiple clause identifiers with |. Valid values:
| \n |
| EmbeddingModelName | string | The name of the embedding model. Valid values:
| text-embedding-v2 |
| RerankModelName | string | The name of the rank model. Valid values:
| gte-rerank-hybrid |
| RerankMinScore | string | The similarity threshold. Valid range: [0.01-1.00]. | 0.01 |
| SourceType | string | The data types of the Collections of Alibaba Cloud Bailian. For document search/audio and video search knowledge bases, possible values:
For data query/image Q&A knowledge bases, possible values:
| DATA_CENTER_FILE |
| DocumentIds | array | The list of file IDs. | |
string | The file ID. | file_8c67b438043848199ffaa903d29addd4_xxxxxxxx | |
| SinkType | string | The vector storage type of the knowledge base. Valid values:
| BUILT_IN |
| SinkInstanceId | string | The ID of the vector storage instance. | gp-bp1gq62t1788yxxxx |
| SinkRegion | string | The region of the vector storage instance. | cn-hangzhou |
| ConfgModel | string | The configuration pattern used by this knowledge base. Valid values:
| recommend |
| EnableRewrite | boolean | Indicates whether multi-turn conversation rewriting is enabled for this knowledge base. Valid values:
| false |
| StructuredIndexConfig | array<object> | The index configuration information of data query or image Q&A knowledge bases. | |
object | |||
| Name | string | The index field name. | name |
| Type | string | The index field type. Enum values:
| string |
| IsSearch | boolean | Indicates whether the field participates in knowledge base retrieval. true indicates that the knowledge base is allowed to search the data in this column. Enum values:
| true |
| IsRecall | boolean | Indicates whether the field participates in model responses. true indicates that the retrieval results of this column serve as input information for the LLM to generate answers. Enum values:
| true |
| PipelineCommercialType | string | The specification type of the knowledge base. Valid values:
| standard |
| PipelineCommercialCu | integer | The number of RCUs of the knowledge base. This parameter is valid only for Ultimate Edition knowledge bases. | 1 |
| PipelineStorageUsage | number | The storage usage of the knowledge base. Unit: GB. | 0.03 |
| Code | string | The error code. | Index.InvalidParameter |
| Message | string | The error message. | Required parameter(%s) missing or invalid, please check the request parameters. |
| Success | boolean | Indicates whether the operation was successful. Valid values:
| true |
| Status | string | The status code returned by the operation. | 200 |
Examples
Success response
JSON format
{
"RequestId": "17204B98-xxxx-4F9A-8464-2446A84821CA",
"Data": {
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 48,
"Indices": [
{
"Id": "lecxr5xxxx",
"Name": "XXXX产品清单",
"Description": "清单中产品主要面向海外客户。",
"StructureType": "UNSTRUCTURED",
"ChunkSize": 5,
"OverlapSize": 10,
"Separator": "\\n",
"EmbeddingModelName": "text-embedding-v2",
"RerankModelName": "gte-rerank-hybrid",
"RerankMinScore": "0.01",
"SourceType": "DATA_CENTER_FILE",
"DocumentIds": [
"file_8c67b438043848199ffaa903d29addd4_xxxxxxxx"
],
"SinkType": "BUILT_IN",
"SinkInstanceId": "gp-bp1gq62t1788yxxxx",
"SinkRegion": "cn-hangzhou",
"ConfgModel": "recommend",
"EnableRewrite": false,
"StructuredIndexConfig": [
{
"Name": "name",
"Type": "string",
"IsSearch": true,
"IsRecall": true
}
],
"PipelineCommercialType": "standard",
"PipelineCommercialCu": 1,
"PipelineStorageUsage": 0.03
}
]
},
"Code": "Index.InvalidParameter",
"Message": "Required parameter(%s) missing or invalid, please check the request parameters.",
"Success": true,
"Status": "200"
}
Error codes
Visit the Error Center to view more error codes.
Release notes
See Release Notes for a complete list.