---
title: "预览分块结果"
method: POST
path: "/chunker/preview"
tags: ["分块"]
---

# 预览分块结果

`POST /chunker/preview`

对提交的文本运行自适应分块器并返回分块预览，不写入数据库不生成 embedding。文本最大 64k 字符

## Request body

- InternalHandlerPreviewChunkingRequest
  - `chunking_config` InternalHandlerPreviewChunkingPayload
    - `child_chunk_size` integer
    - `chunk_overlap` integer
    - `chunk_size` integer
    - `enable_parent_child` boolean
    - `languages` string[]
    - `parent_chunk_size` integer
    - `separators` string[]
    - `strategy` string
    - `token_limit` integer
  - `text` string

## Response `200`

分块结果

- InternalHandlerPreviewChunkingResponse
  - `chunks` InternalHandlerPreviewChunkResult[]
    - `content` string
    - `context_header` string
    - `end` integer
    - `seq` integer
    - `size_chars` integer
    - `size_tokens_approx` integer
    - `start` integer
  - `profile` GithubComTencentWeKnoraInternalInfrastructureChunkerDocProfile
    - `all_caps_short_line_count` integer
    - `avg_line_len` number
    - `blank_paragraph_breaks` integer
    - `chinese_chapter_count` integer
    - `code_ratio` number
    - `detected_langs` string[] — Detected language hints (best-effort)
    - `english_chapter_count` integer
    - `form_feed_count` integer
    - `german_chapter_count` integer
    - `has_code` boolean
    - `has_tables` boolean — Content characteristics
    - `md_heading_counts` object — Markdown structure
    - `md_heading_total` integer
    - `numbered_section_count` integer — Heuristic indicators
    - `repeated_footer_count` integer
    - `std_line_len` number
    - `total_chars` integer
    - `total_lines` integer
    - `visual_sep_count` integer
  - `rejected` GithubComTencentWeKnoraInternalInfrastructureChunkerTierRejection[]
    - `reason` string
    - `tier` 'heading' | 'heuristic' | 'legacy'
  - `selected_tier` 'heading' | 'heuristic' | 'legacy'
  - `stats` InternalHandlerPreviewChunkingStats
    - `avg_chars` integer
    - `count` integer
    - `max_chars` integer
    - `min_chars` integer
    - `stddev_chars` integer
    - `truncated_to` integer — TruncatedTo, when set, is the original chunk count before the response was truncated to previewMaxChunks for transport.
  - `tier_chain` GithubComTencentWeKnoraInternalInfrastructureChunkerStrategyTier[]

## Other responses

- `400` — 请求参数错误
- `413` — 文本超过预览限制
- `504` — 分块超时

---

[API](https://skmtc.net/tencentblueking/apis/weknora-api.md) · [All operations](https://skmtc.net/tencentblueking/apis/weknora-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tencentblueking/weknora-api/revisions/abce9036def5/schema)
