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 invoking this operation. Alibaba Cloud accounts can invoke this operation directly without authorization. Use the latest Alibaba Cloud Model Studio SDK to invoke this operation. - This operation has idempotence.
Try it now
Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.
Test
RAM authorization
The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:
-
Action: The actions can be used in the
Actionelement of RAM permission policy statements to grant permissions to perform the operation. - API: The API that you can call to perform the action.
- Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.
-
Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.
- For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the
Resourceelement of the policy. - For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the
Resourceelement of the policy.
- For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the
- Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.
- Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.
Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
sfm:ListIndex | list | *All Resource
| None | None |
Request syntax
Path Parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The ID of the workspace to which the knowledge base belongs. For information about how to obtain the workspace ID, 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 search for a knowledge base by name. The name must be 1 to 20 characters in length and can contain characters in the Unicode letter category (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 to query. Minimum value: 1. Default value: 1. | 1 |
| PageSize | string | No | The number of knowledge bases to display per page in a paged 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 specified page number. | 1 |
| PageSize | integer | The specified number of entries per page. | 10 |
| TotalCount | integer | The total number of entries returned. | 48 |
| Indices | array<object> | The list of knowledge bases. | |
array<object> | The knowledge base object. | ||
| Id | string | The knowledge base ID, which is the | lecxr5xxxx |
| Name | string | The knowledge base name. | XXXX Product List |
| Description | string | The knowledge base description. | Products in this list are mainly for overseas customers |
| StructureType | string | The knowledge base type. Valid values:
| UNSTRUCTURED |
| ChunkSize | integer | The estimated chunk size. Valid values: 1 to 2048. | 5 |
| OverlapSize | integer | The chunk overlap size. Valid values: 0 to 1024. | 10 |
| Separator | string | The sentence separator. If multiple separators are used, they are separated by |. Valid values:
| \n |
| EmbeddingModelName | string | The embedding model name. Valid values:
| text-embedding-v2 |
| RerankModelName | string | The rerank model name. Valid values:
| gte-rerank-hybrid |
| RerankMinScore | string | The similarity threshold. Valid values: 0.01 to 1.00. | 0.01 |
| SourceType | string | The data type in Alibaba Cloud Model Studio Application Data. For document search knowledge bases, valid values:
For data query/image Q&A knowledge bases, valid 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 instance ID of the vector storage for the knowledge base. | gp-bp1gq62t1788yxxxx |
| SinkRegion | string | The region of the vector storage instance for the knowledge base. | cn-hangzhou |
| ConfgModel | string | The configuration mode 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> | ||
object | |||
| Name | string | name | |
| Type | string | Valid values:
| string |
| IsSearch | boolean | Valid values:
| true |
| IsRecall | boolean | Valid values:
| true |
| Code | string | The error status 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