UpdateChunk
Modifies the content and title of a specified text chunk in a knowledge base, and specifies whether the chunk participates in knowledge base retrieval.
Operation description
-
Key limits: This operation supports only document search knowledge bases. Data query and image Q&A knowledge bases are not supported.
-
Permission requirements:
- RAM user (sub-account): You must obtain the API permissions for Alibaba Cloud Model Studio (you can use the AliyunBailianDataFullAccess policy, which includes the sfm:UpdateChunk permission point 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.
-
Calling method: We recommend that you use the latest Alibaba Cloud Model Studio SDK. The SDK encapsulates complex signature calculation logic and simplifies the invocation procedure.
-
Effective latency: Updates typically take effect immediately. During peak hours, a slight delay (seconds) may occur.
-
Idempotence: This operation is idempotent. If you repeat the operation on a text chunk that has already been successfully updated, the operation returns a success response.
Rate limit: This operation is throttled if called too frequently. Do not exceed 10 calls per second. If you are throttled, retry later.
Debug
You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples.
Authorization information
The following table describes the authorization information for this 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:
- 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 action: other permissions required to successfully perform the action. The caller must also have the permissions of the related actions for the operation to succeed.
| Action | Access level | Resource type | Condition key | Related action |
|---|---|---|---|---|
| sfm:UpdateChunk | update | *All resources * |
| None |
Request syntax
POST /{WorkspaceId}/chunk/update HTTP/1.1
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| PipelineId | string | Yes | The knowledge base ID, that is, the | 79c0alxxxx |
| DataId | string | Yes | The file ID, that is, the | doc_c134aa2073204a5d936d870bf960f56axxxxxxxx |
| ChunkId | string | Yes | The ID of the text chunk to modify. You can obtain this value by calling the ListChunks operation. The value is in the Node.Metadata._id field of the response. | llm-5ip55o1zrzxx_09fe52x_xxxxx_033b551e10024029992e79767b151fxx_10024xx_0 |
| IsDisplayedChunkContent | boolean | Yes | Specifies whether this text chunk participates in knowledge base retrieval. Valid values:
Default value: true. | true |
| content | string | Yes | The new content of the text chunk. The content must be 10 to 6000 characters in length and cannot exceed the maximum segment length specified when the knowledge base was created. | The type of certainty attained in philosophy is not scientific certainty (that is, certainty that is the same for everyone's reason), but rather a kind of insight that can only be attained within the whole essence of human beings. Every form of philosophy differs from science, in that no philosophy has gained unanimous recognition... |
| WorkspaceId | string | Yes | The workspace ID to which the knowledge base belongs. For information about how to obtain the workspace ID, see How to use workspaces. | llm-3z7uw7fwz0vexxxx |
| title | string | No | The new title of the text chunk. The length is limited to 0 to 50 characters, and an empty string is allowed. If you pass an empty string, the existing title is cleared; if you do not pass this parameter, the original title remains unchanged. | What is philosophy |
Response elements
| 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 operation 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",
"Code": "",
"Message": "",
"Success": true,
"Data": true,
"Status": 200
}
Error codes
Visit Error Center to view more error codes.