feat: add include_provenance option to chunk endpoints#647
Open
pablopupo wants to merge 1 commit into
Open
Conversation
The synchronous chunk endpoints can now return each doc_items entry as an object with self_ref, label and the resolved prov array (page_no, bbox, charspan) instead of a bare JSON pointer reference. The flag is opt-in and off by default, so the existing response shape is unchanged. Signed-off-by: pablopupo <145598901+pablopupo@users.noreply.github.com>
Contributor
|
✅ DCO Check Passed Thanks @pablopupo, all your commits are properly signed off. 🎉 |
Contributor
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The chunk endpoints return doc_items as bare JSON pointer refs, so bounding boxes and page numbers are not available without re-running the conversion and resolving the refs client side. This adds an opt-in
include_provenancechunking option (chunking_include_provenanceas form field) to the synchronous chunk endpoints. When set, each doc_items entry is returned as an object with self_ref, label and the resolved prov array (page_no, bbox, charspan). The flag is off by default and the existing response shape is unchanged.The endpoints ask the worker for the converted document, resolve the refs against it when building the response, and drop the document again unless the client requested it with include_converted_doc. Long term this could live in docling-jobkit's chunker serialization instead (happy to follow up there if you prefer that route).
Tests cover both hybrid endpoints with the flag on and off.
Issue resolved by this Pull Request:
Resolves #613