tencent cloud

APIs

ChunkDocument

Download
フォーカスモード
フォントサイズ
最終更新日: 2026-07-22 18:06:51

1. API Description

Domain name for API request: es.intl.tencentcloudapi.com.

Text segmentation is a technology that splits long text into short fragments for adapting to model input, improving processing efficiency, or information retrieval. It balances fragment length and semantic consistency, suitable for NLP and data analysis scenarios.
This API is used to slice text based on delimiter rules. It has a single-account call limit. If you need to increase the concurrent limit, please contact us (https://www.tencentcloud.com/act/event/Online_service?from_cn_redirect=1).

A maximum of 100 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ChunkDocument.
Version Yes String Common Params. The value used for this API: 2025-01-01.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
Document Yes ChunkDocument Slice file info.
ModelName Yes String Model name, selectable model list: doc-chunk.
Config No ChunkConfig File slice configuration.

3. Output Parameters

Parameter Name Type Description
Chunks Array of Chunk None.
Usage Usage token consumption
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Real-time Document Slicing

Input Example

POST / HTTP/1.1
Host: es.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ChunkDocument
<Common request parameters>

{
    "Document": {
        "FileType": "TXT",
        "FileContent": "Slice based on separator and text length, applicable to text with strong rules"
    },
    "ModelName": "doc-chunk",
    "Config": {
        "MaxChunkSize": 4800,
        "Delimiters": [
            ","
        ],
        "ChunkOverlap": 4000
    }
}

Output Example

{
    "Response": {
        "Chunks": [
            {
"Content": "Slice based on separator and text length, applicable to text with strong rules."
                "Index": 0
            }
        ],
        "Usage": {
            "TotalTokens": 17
        },
        "RequestId": "eeb0d39a-8a4a-431b-a577-2595202afaa1"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

There is no error code related to the API business logic. For other error codes, please see Common Error Codes.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック