Adds chunks to a document search (document), data query (table), or image Q&A (image) knowledge base.
Operation description
- This operation adds chunk content to a specified knowledge base of the document search (document), data query (table), or image Q&A (image) type. Related operations on multimedia search (multimedia) knowledge bases are not supported. For data query and image Q&A knowledge bases, this operation takes effect only when the data source is a spreadsheet connector (excel).
- Resource Access Management (RAM) users must first obtain API permissions for Model Studio (requiring
AliyunBailianDataFullAccess, which includes the sfm:ChunkList permission) and join a workspace before invoking this operation. Alibaba Cloud accounts can invoke this operation directly without authorization. Use the latest Model Studio SDKModel Studio SDK to invoke this operation. - Before invoking this operation, make sure that your knowledge base has been created and has not been deleted (that is, the knowledge base ID
IndexIdis valid). - This operation has idempotence.
Try it now
Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.
Test
RAM authorization
No authorization for this operation. If you encounter issues with this operation, contact technical support.
Request syntax
Path Parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The workspace ID. | llm-19hxxxxx7htdf9lh |
Request parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| PipelineId | string | Yes | The knowledge base ID. | 79c0alxxxx |
| dataId | string | No | The file ID. | doc_xxx |
| field | object | No | The chunk content to insert, passed as key-value pairs. For document search knowledge bases, use the following fixed key list:
For data query and image Q&A knowledge bases, the keys are not fixed and are determined by the data source spreadsheet of the knowledge base. The key is the Excel column header, and the value is the corresponding column value. | { "content": "The Bailian platform supports parsing multiple document formats including PDF, Word, and PPT.", "title": "Document Parsing and Chunking", "image_urls": [ "https://example.com/images/chunk-flow.png", "https://example.com/images/parsing-result.png" ] } |
any | No | The header field information for the inserted chunk. Only data query and image Q&A knowledge bases are supported. Headers that participate in retrieval or response generation are required. Value requirements for each type:
| {"Product Name": "Wireless Bluetooth Headphones", "Publish Time": 1752624000000, "Stock Quantity": 1580, "Unit Price": 299.99, "image_url":"https://example.com/images/headphones-front.jpg,https://example.com/images/headphones-side.jpg,https://example.com/images/headphones-package.jpg" } |
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. | Index.InvalidParameter |
| Message | string | The error message. | Required parameter(%s) missing or invalid, please check the request parameters. |
| Success | boolean | Indicates whether the operation was successful. Valid values:
| true |
| Data | boolean | The business data returned upon a successful request. Valid values:
| true |
| Status | string | The status code returned by the operation. | 200 |
Examples
Success response
JSON format