Creates document chunks based on your business scenarios.
Operation description
Before you use this API, make sure that you fully understand the billing methods and pricing of Tongyi Dianjin.
Prerequisites
- Alibaba Cloud Model Studio and Tongyi Dianjin are activated.
- Obtain the workspaceId: Obtain the workspace identity.
Try it now
You can call this API directly in OpenAPI Explorer, which saves you the trouble of calculating signatures. After a successful call, OpenAPI Explorer can automatically generate SDK code examples.
Try it now
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:
- Action: the specific permission point.
- Access level: the access level of each action. Valid values: Write, Read, and List.
-
Resource type: the resource types that support authorization in the action. Details:
- Required resource types are marked with an asterisk (*) prefix.
- For actions that do not support resource-level authorization,
All resourcesis used.
- Condition key: the condition keys defined by the cloud service.
- Dependent action: the other permissions required to successfully run the action. The operator must have the permissions of all dependent actions for the action to succeed.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| dianjin:CreatePredefinedDocument | create | *All resources * |
| None |
Request syntax
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| workspaceId | string | Yes | Path parameter. The workspace ID. | llm-xxxxx |
| body | object | No | The request body. | |
| chunks | array<object> | No | A list of document chunks. | |
| Chunk | object | No | ||
| chunkMeta | object | No | The metadata of the document chunk. | {"a": "1"} |
| chunkOrder | integer | No | The order. This parameter is optional. | 1 |
| chunkText | string | No | The text of the document chunk. | This is a test text |
| chunkType | string | No | The type of the document chunk. | text |
| libraryId | string | No | The ID of the document library. | a1b2c3 |
| metadata | object | No | The metadata. | {"a": "1"} |
| title | string | No | The title of the document. | Test document |
Response elements
| Element | Type | Description | Example |
|---|---|---|---|
| object | ResultCode | ||
| cost | long | The time consumed. | null |
| data | string | The returned data. | 1782981430906818562 |
| dataType | string | The data type. | null |
| errCode | string | The error code. | 0 |
| message | string | The error message. | ok |
| requestId | string | The request ID. | 0a06dfe617018288881568684e2937 |
| success | boolean | Indicates whether the request is successful. | true |
| time | string | The timestamp. | 2024-04-24 11:54:34 |
Examples
Success response
JSON format