UpdateChunk

Updated at:

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.

Debug

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

ActionAccess levelResource typeCondition keyRelated action
sfm:UpdateChunkupdate
*All resources
*
    None
None

Request syntax

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

Request parameters

NameTypeRequiredDescriptionExample value
PipelineIdstringYes

The knowledge base ID, that is, the Data.Id returned when the knowledge base is created by using the CreateIndex operation, or obtained on the Knowledge Base page.

79c0alxxxx
DataIdstringYes

The file ID, that is, the FileId returned by the AddFile operation. You can also obtain it on the Application Data - Files tab in the Alibaba Cloud Model Studio console by clicking the ID icon next to the corresponding file.

doc_c134aa2073204a5d936d870bf960f56axxxxxxxx
ChunkIdstringYes

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
IsDisplayedChunkContentbooleanYes

Specifies whether this text chunk participates in knowledge base retrieval. Valid values:

  • true: Participates.
  • false: Does not participate.

Default value: true.

true
contentstringYes

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...
WorkspaceIdstringYes

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
titlestringNo

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

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 operation was successful. Valid values:

  • true: Succeeded.
  • false: 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",
  "Code": "",
  "Message": "",
  "Success": true,
  "Data": true,
  "Status": 200
}

Error codes

Visit Error Center to view more error codes.