Skip to content

fix(service): allow passing HybridChunkerOptions to chunk()#3337

Open
alexdmds wants to merge 2 commits intodocling-project:mainfrom
alexdmds:fix/service-client-chunk-options
Open

fix(service): allow passing HybridChunkerOptions to chunk()#3337
alexdmds wants to merge 2 commits intodocling-project:mainfrom
alexdmds:fix/service-client-chunk-options

Conversation

@alexdmds
Copy link
Copy Markdown

Problem

chunk(), submit_chunk() and _submit_chunk_task() only accepted a ChunkerKind
enum and always instantiated HybridChunkerOptions() with default values internally.
This made tokenizer, max_tokens, merge_peers and include_raw_text impossible
to configure from the client, even though these fields are defined on HybridChunkerOptions.

Fix

The three methods now accept either a ChunkerKind (unchanged behaviour) or a fully
instantiated HybridChunkerOptions / HierarchicalChunkerOptions, which is forwarded
as-is to the service endpoint.

Tests

Three unit tests added using httpx.MockTransport:

  • backward compat: ChunkerKind.HYBRID still routes to /v1/chunk/hybrid/file/async
  • custom options: tokenizer, max_tokens, include_raw_text appear in the request body
  • hierarchical: HierarchicalChunkerOptions routes to /v1/chunk/hierarchical/file/async

…ptions to chunk()

chunk(), submit_chunk() and _submit_chunk_task() previously only accepted a
ChunkerKind enum and always created HybridChunkerOptions() with default values,
making tokenizer, max_tokens, merge_peers and include_raw_text impossible to
configure from the client.

These methods now accept either a ChunkerKind (unchanged behaviour) or a fully
instantiated HybridChunkerOptions / HierarchicalChunkerOptions, which is then
forwarded as-is to the service endpoint.

Adds three unit tests covering backward-compat (ChunkerKind), custom hybrid
options, and hierarchical options.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

DCO Check Passed

Thanks @alexdmds, all your commits are properly signed off. 🎉

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 21, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

I, Alexis De Monts <alexis.demonts@cleyrop.com>, hereby add my Signed-off-by to this commit: cc526c0

Signed-off-by: Alexis De Monts <alexis.demonts@cleyrop.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant