Skip to main content

UpdateDocumentChunk

Update the text content of a document chunk in a document.

Operation description

Before using this API, ensure that you fully understand the billing methods and pricing of Tongyi Dianjin. Prerequisites Alibaba Cloud Model Studio and Tongyi Dianjin services are activated. Obtain the workspaceId: Obtain the workspace identifier.

Debugging

You can run this API directly in OpenAPI Explorer, which saves you the trouble of calculating signatures. After the operation succeeds, OpenAPI Explorer can automatically generate SDK code examples. Try it now

RAM authorization

The following table describes the authorization information for this API. You can use the Action element in RAM permission policy statements to grant RAM users or RAM roles the permission to call this API. Details are as follows:
  • Action: refers to the specific permission point.
  • Access level: refers to the access level of each operation. Valid values: Write, Read, or List.
  • Resource type: refers to the resource types that support authorization in the operation. Details are as follows:
    • Required resource types are marked with a leading asterisk (*).
    • For operations that do not support resource-level authorization, All Resources is used.
  • Condition key: refers to the condition keys defined by the cloud service itself.
  • Dependent action: refers to other permissions required to successfully perform the operation. The caller must have the permissions of all dependent actions before the operation can succeed.
ActionAccess levelResource typeCondition keyDependent action
dianjin:UpdateDocumentChunkupdate
*All Resources
*
    None
None

Request syntax

PUT /{workspaceId}/api/library/updateDocumentChunk HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample
workspaceIdstringYes

Workspace ID.

llm-xxxxx
bodyobjectNo

Request body parameters.

libraryIdstringYes

Document library ID.

sjdgdsfg
chunksarray<object>Yes

List of document chunks.

chunkobjectYes

Document chunk.

chunkIdstringYes

Document chunk ID.

1987834755763847
chunkTextstringYes

Document chunk text.

This is a test text

Response parameters

NameTypeDescriptionExample
object

ResultCode

successboolean

Is successful.

true
dataTypestring

Data type.

null
timestring

Timestamp.

2024-01-01 00:00:00
errCodestring

Error code.

0
messagestring

Error message.

ok
datastring

Response data.

SUCCESS
requestIdstring

Request ID.

003D019A-1BB3-53EC-A0D2-CE76DA5D73B1
costlong

Processing time

null

Examples

Success response JSON format
{
  "success": true,
  "dataType": null,
  "time": "2024-01-01 00:00:00",
  "errCode": 0,
  "message": "ok",
  "data": "SUCCESS",
  "requestId": "003D019A-1BB3-53EC-A0D2-CE76DA5D73B1",
  "cost": 0
}

Error codes

Visit the Error Center to view more error codes.