Queries the list and information of text chunks.
Operation description
- For document search or audio and video search knowledge bases, this operation can query all chunk content of a specified file; for data query or image Q&A knowledge bases, it can retrieve information about all text chunks.
- RAM users (sub-accounts) must first obtain the API permissions of Alibaba Cloud Model Studio (AliyunBailianDataFullAccess is required, which already includes the sfm:ChunkList permission point) and join a workspace before they can call this operation. Alibaba Cloud accounts (primary accounts) can call this operation directly without authorization. We recommend that you call this operation by using the latest version of the Alibaba Cloud Model Studio SDK.
- Before you call this operation, make sure that your knowledge base has been created and has not been deleted (that is, the knowledge base ID IndexId is valid).
- This operation is idempotent.
Debugging
You can run this operation directly in OpenAPI Explorer, which saves you the trouble of calculating signatures. After the operation runs successfully, OpenAPI Explorer can automatically generate SDK code examples.
Debug
Authorization information
The following table describes the authorization information of the API. You can use it in the Action element of RAM policy statements to grant RAM users or RAM roles the permission to call this API. The details are as follows:
- Operation: the specific permission point.
- Access level: the access level of each operation. Valid values: Write, Read, or List.
-
Resource type: the resource types that support authorization in the operation. The details are as follows:
- For required resource types, an asterisk (*) is added as a prefix.
- For operations that do not support resource-level authorization,
All Resourcesis used.
- Condition key: the condition keys defined by the cloud service itself.
- Related operation: other permissions required to successfully perform the operation. The caller must also have the permissions of the related operations for the operation to succeed.
| Operation | Access level | Resource type | Condition key | Related operation |
|---|---|---|---|---|
| sfm:ChunkList | list | *All Resources * |
| None |
Request syntax
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The ID of the workspace to which the knowledge base belongs. For information about how to obtain it, see How to use workspaces. | llm-3z7uw7fwz0vxxxx |
| body | object | No | The body of the request parameters. | |
| Fields | array | No | Fields is an array of field names used to filter the non-private fields (those not prefixed with an underscore _) in the Metadata field returned by this operation. By default, when Fields is empty, all non-private fields in the Metadata field are returned. If you want the returned Metadata field to contain only the specified non-private fields, such as only title, pass title in this parameter. Default value: empty. | |
| string | No | The field name. | name | |
| Filed | string | No | This field is the file ID field in the legacy Alibaba Cloud Model Studio SDK. Its usage and default value are exactly the same as those of the
Note How to check the Alibaba Cloud Model Studio SDK version: Visit the Alibaba Cloud Model Studio SDK center, click "Install" in the left-side navigation pane, set the API version to "2023-12-29", select your programming language, and then click "History Versions" to view the versions. | file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx |
| FileId | string | No | The file ID, that is, the | file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx |
| IndexId | string | Yes | The knowledge base ID, that is, the | otoru9xxxx |
| PageNum | integer | No | The page number to query. The starting value is 1. Default value: 1. | 1 |
| PageSize | integer | No | The number of text chunks displayed on each page in a paged query. Maximum value: 100. Default value: 10. | 10 |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| object | |||
| Code | string | The error status code. | Index.InvalidParameter |
| Data | object | The business fields returned by the operation. | |
| Nodes | array<object> | The list of text chunks. | |
| nodes | object | The text chunk object. | |
| Metadata | any | The metadata map of the text chunk. Note In the metadata map of a document search knowledge base, the file_path field is meaningless. Do not use it in business code.Note When you retrieve from a document search knowledge base, if a chunk contains images, they will be exposed through the image_url field in the metadata map, together with an expiration time. | { "file_path": "https://bailian-***", "parent": "Alibaba Cloud Model Studio is a one-stop platform for developing large models and building applications. Both developers and business users can deeply participate in the design and construction of large model applications. Through simple interface operations, you can develop a large model application in 5 minutes or train a custom model in a few hours, allowing you to focus more on application innovation.", "is_displayed_chunk_content": "true", "image_url": [], "nid": "83***", "source": "0", "_score": 0, "title": "", "doc_id": "file_24e***", "content": "Alibaba Cloud Model Studio is a one-stop platform for developing large models and building applications. Both developers and business users can deeply participate in the design and construction of large model applications. Through simple interface operations, you can develop a large model application in 5 minutes or train a custom model in a few hours, allowing you to focus more on application innovation.", "_rc_score": 0, "workspace_id": "llm-zna***", "hier_title": "", "doc_name": "What is Alibaba Cloud Model Studio", "pipeline_id": "j6b***", "_id": "llm-zna5***" } |
| Score | double | The similarity score of the text chunk. | 0 |
| Text | string | The content of the text chunk. | Alibaba Cloud Model Studio is a one-stop platform for developing large models and building applications. Both developers and business users can deeply participate in the design and construction of large model applications. Through simple interface operations, you can develop a large model application in 5 minutes or train a custom model in a few hours, allowing you to focus more on application innovation. |
| Total | long | The total number of returned results. | 1 |
| Message | string | The error message. | Required parameter(%s) missing or invalid, please check the request parameters. |
| RequestId | string | The request ID. | 8F97A63B-xxxx-527F-9D6E-467B6A7E8CF1 |
| Status | string | The status code returned by the operation. | 200 |
| Success | boolean | Indicates whether the operation call is successful. Valid values:
| true |
Examples
Success response example
JSON format