Deletes a specified text chunk from a knowledge base. The deleted chunk cannot be retrieved or recalled.
Operation description
**
Warning After a text chunk is deleted, it cannot be restored. Proceed with caution.
-
Required permissions:
- RAM users: Must first obtain the API permissions of Model Studio (such as the
AliyunBailianDataFullAccesspolicy, which includes the sfm:DeleteChunk permission required), and become member of a workspace. - Alibaba Cloud account: Has the permission by default, and can call the operation directly.
- RAM users: Must first obtain the API permissions of Model Studio (such as the
-
Call method: We recommend using the latest version of the GenAI Service Platform SDK. The SDK encapsulates complex signature computational logic to simplify the call process.
-
Delay: The update takes effect immediately. During peak hours, the update may take place in seconds.
-
Idempotence: This operation is idempotent. If you perform a repeated operation on a chunk that has already been deleted, the interface returns a success.
Rate limit: Rate limiting will be triggered if you call this operation frequently. Do not exceed 10 times per second. If limiting is triggered, try again later.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| sfm:DeleteChunk | delete | *All Resources * |
| none |
Request syntax
POST /{WorkspaceId}/chunk/delete HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| PipelineId | string | Yes | The knowledge base ID, which is the | 79c0alxxxx |
| WorkspaceId | string | Yes | The ID of the workspace to which the knowledge base belongs. For more information, see How to use workspace. | llm-3z7uw7fwz0vexxxx |
| ChunkIds | array | Yes | The list of text chunks to be deleted. You can specify up to 10 chunk IDs at a time. | |
| string | Yes | The text chunk ID, which is the | llm-5ip55o1zrzxx_09fe52x_table_033b551e10024029992e79767b151fxx_10024xx_0 |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "35A267BF-xxxx-54DB-8394-AA3B0742D833\n",
"Code": "InvalidParameter\n",
"Message": "Required parameter(%s) missing or invalid, please check the request parameters.\n",
"Success": true,
"Data": true,
"Status": 200
}Error codes
For a list of error codes, visit the Service error codes.
