DeleteChunk

Updated at:

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.

Debug

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 Resources is 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.

ActionAccess levelResource typeCondition keyDependent action
sfm:DeleteChunkdelete
*All Resources
*
    None
None

Request syntax

POST /{WorkspaceId}/chunk/delete HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample value
PipelineIdstringYes

The knowledge base ID, which is the Data.Id returned by the CreateIndex operation.

79c0alxxxx
WorkspaceIdstringYes

The workspace ID of the knowledge base. For how to obtain it, see How to use workspaces.

llm-3z7uw7fwz0vexxxx
ChunkIdsarrayYes

The list of text chunks to delete (a maximum of 10 text chunk IDs can be specified in a single request).

stringYes

The text chunk ID, which is the _id field in Metadata of the Node object returned by the ListChunks operation.

llm-5ip55o1zrzxx_09fe52x_xxxxx_033b551e10024029992e79767b151fxx_10024xx_0

Response parameters

NameTypeDescriptionExample value
object

Schema of Response

RequestIdstring

The request ID.

35A267BF-xxxx-54DB-8394-AA3B0742D833
Codestring

The error status code.

Messagestring

The error message.

Successboolean

Indicates whether the call was successful. Valid values:

  • true: The call was successful.
  • false: The call failed.
true
Databoolean

The business data returned upon a successful request.

true
Statusstring

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.