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
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sfm:ListIndex |
list |
*All Resource
|
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 primary key ID of the knowledge base, which is the |
lecxr5xxxx |
| Name |
string |
The name of the knowledge base. |
XXXX产品清单 |
| Description |
string |
The description of the knowledge base. |
清单中产品主要面向海外客户。 |
| StructureType |
string |
The vector storage 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 |
Similarity Threshold Valid values: [0.01-1.00]. |
0.01 |
| SourceType |
string |
The data type of Data Management. For unstructured knowledge base, possible values:
For structured knowledge base, possible values:
|
DATA_CENTER_FILE |
| DocumentIds |
array |
The list of the primary key IDs of the documents. |
|
|
string |
The primary key ID of the document. |
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 |
| 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
}
]
},
"Code": "Index.InvalidParameter",
"Message": "Required parameter(%s) missing or invalid, please check the request parameters.",
"Success": true,
"Status": "200"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.