This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(DoclingReader): enable reading from JSON
Lazy load reader of docling documents as JSON. Unit test for this method. Signed-off-by: Cesar Berrospi Ramis <[email protected]>
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# Copyright IBM Corp. 2024 - 2024 | ||
# SPDX-License-Identifier: MIT | ||
# | ||
|
||
import os | ||
|
||
from quackling.llama_index.readers.docling_reader import DoclingReader | ||
|
||
|
||
def test_lazy_load_docs(): | ||
reader = DoclingReader(parse_type=DoclingReader.ParseType.JSON) | ||
|
||
file_path = "tests/unit/data/0_inp_dl_doc.json" | ||
assert os.path.exists(file_path) | ||
li_docs = list(reader.lazy_load_docs(file_path)) | ||
assert len(li_docs) == 1 |