Skip to content

expose include_orig_elements param in api#1

Merged
tylorbayer merged 1 commit into
mainfrom
06-17-expose_include_orig_elements_param_in_api
Jun 18, 2026
Merged

expose include_orig_elements param in api#1
tylorbayer merged 1 commit into
mainfrom
06-17-expose_include_orig_elements_param_in_api

Conversation

@tylorbayer

@tylorbayer tylorbayer commented Jun 17, 2026

Copy link
Copy Markdown

TL;DR

Adds include_orig_elements as a new form parameter to control whether original elements are included in chunk metadata.

What changed?

A new include_orig_elements boolean parameter (defaulting to True) has been added to the API. When True, the elements used to form each chunk are attached to that chunk's .metadata.orig_elements as a gzipped+base64 blob. When set to False, these blobs are omitted from the response. The parameter is wired through GeneralFormParams, pipeline_api, and all relevant chunking call sites.

How to test?

Submit a document partition request with include_orig_elements=false in the form body and verify that the response chunks do not contain orig_elements in their metadata. Submit the same request with include_orig_elements=true (or omit the parameter entirely) and confirm that orig_elements is present in the chunk metadata as expected.

Why make this change?

For large documents — particularly those with large tables — the orig_elements blob gets duplicated into every chunk, which can dramatically inflate the response payload size. Giving callers the option to opt out of this behavior allows them to receive significantly smaller responses when the original element data is not needed.

Copy link
Copy Markdown
Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@tylorbayer tylorbayer requested a review from jackson-david June 17, 2026 21:20
@tylorbayer tylorbayer marked this pull request as ready for review June 17, 2026 21:21
@tylorbayer tylorbayer force-pushed the 06-17-expose_include_orig_elements_param_in_api branch 2 times, most recently from d029577 to 0947fbf Compare June 18, 2026 21:15
@tylorbayer tylorbayer requested a review from FouL06 June 18, 2026 21:15
@tylorbayer tylorbayer force-pushed the 06-17-expose_include_orig_elements_param_in_api branch from 0947fbf to 2ee4b10 Compare June 18, 2026 21:17
@tylorbayer tylorbayer merged commit 7463efd into main Jun 18, 2026
2 of 5 checks passed
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.

3 participants