DeleteChunk
Deletes specified text chunks from a knowledge base. Deleted text chunks cannot be retrieved or recalled.
Operation description
Warning Deleted text chunks cannot be recovered (hard delete). Proceed with caution.
-
Permission requirements:
- RAM user (sub-account): You must first obtain the API permissions for Alibaba Cloud Model Studio (you can use the AliyunBailianDataFullAccess policy, which includes the sfm:DeleteChunk permission required by this operation), and join a workspace before you can call this operation.
- Alibaba Cloud account (primary account): Has permissions by default and can call this operation directly.
-
Invocation method: We recommend that you use the latest Alibaba Cloud Model Studio SDK, which encapsulates the complex signature calculation logic and simplifies the invocation process.
-
Effective latency: Changes typically take effect immediately, with a possible slight delay (seconds) during peak hours.
-
Idempotency: This operation is idempotent. When you repeatedly delete a text chunk that has already been successfully deleted, the operation returns a success response.
Rate limit: This operation is throttled if called too frequently. Do not exceed 10 calls per second. If throttled, retry later.
Debug
You can run this operation directly in OpenAPI Explorer, sparing you from signature calculation. After a successful run, OpenAPI Explorer can automatically generate SDK code examples.
RAM authorization
The following table describes the authorization information of the API. You can use it in the Action element of a RAM policy statement to grant RAM users or RAM roles the permission to call this API. Details are as follows:
-
Action: 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 for the operation. Details are as follows:
- Required resource types are marked with a preceding asterisk (*).
- For operations that do not support resource-level authorization,
All Resourcesis used.
-
Condition key: The condition keys defined by the cloud service itself.
-
Dependent action: Other permissions required to successfully perform the operation. The caller must also have the permissions of the dependent actions for the operation to succeed.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| sfm:DeleteChunk | delete | *All Resources * |
| None |
Request syntax
POST /{WorkspaceId}/chunk/delete HTTP/1.1
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| PipelineId | string | Yes | The knowledge base ID, which is the | 79c0alxxxx |
| WorkspaceId | string | Yes | The workspace ID of the knowledge base. For how to obtain it, see How to use workspaces. | llm-3z7uw7fwz0vexxxx |
| ChunkIds | array | Yes | The list of text chunks to delete (a maximum of 10 text chunk IDs can be specified in a single request). | |
| string | Yes | The text chunk ID, which is the | llm-5ip55o1zrzxx_09fe52x_xxxxx_033b551e10024029992e79767b151fxx_10024xx_0 |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| object | Schema of Response | ||
| RequestId | string | The request ID. | 35A267BF-xxxx-54DB-8394-AA3B0742D833 |
| Code | string | The error status code. | |
| Message | string | The error message. | |
| Success | boolean | Indicates whether the call was successful. Valid values:
| true |
| Data | boolean | The business data returned upon a successful request. | true |
| Status | string | The status code returned by the operation. | 200 |
Examples
Success response
JSON format
{
"RequestId": "35A267BF-xxxx-54DB-8394-AA3B0742D833\n",
"Code": "",
"Message": "",
"Success": true,
"Data": true,
"Status": 200
}
Error codes
Visit Error Center to view more error codes.