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:
Resource Access Management (RAM) user: Before invoking this operation, obtain API permissions for Model Studio (you can use the
AliyunBailianDataFullAccesspolicy, which includes the sfm:UpdateChunk permission required by this operation), and join a workspace.Alibaba Cloud account: Has permissions by default and can invoke this operation directly.
Calling method: Use the latest Model Studio SDK. The SDK provides encapsulation of 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 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.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sfm:UpdateChunk |
update |
*All Resource
|
None | None |
Request syntax
POST /{WorkspaceId}/chunk/update HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| WorkspaceId |
string |
Yes |
The workspace ID of the knowledge base. For information about how to obtain the workspace ID, see How to use a workspace. |
llm-3z7uw7fwz0vexxxx |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PipelineId |
string |
Yes |
The knowledge base ID. This is the |
79c0alxxxx |
| DataId |
string |
Yes |
The file ID. This 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 length must be between 10 and 6000 characters and cannot exceed the maximum segment length specified when the knowledge base was created. |
在哲学中所获得的确定性类型不是科学的确定性(即对每个人的理智来说都一样的确定性),而是一种要在人类的整体本质中才能获得的亲证。哲学的每一形态都不同于科学,因为所有的哲学都没有得到一致的认可... |
| title |
string |
No |
The new title of the text chunk. The length is limited to 0 to 50 characters. 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 is retained. |
什么是哲学 |
Response elements
|
Element |
Type |
Description |
Example |
|
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": "InvalidParameter\n",
"Message": "Required parameter(%s) missing or invalid, please check the request parameters.",
"Success": true,
"Data": true,
"Status": "\"200\""
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.