From 4ca4ccf7013ea171af47cbaa99a5a02e1dd20afd Mon Sep 17 00:00:00 2001 From: Alessio Vertemati Date: Fri, 6 Mar 2026 11:50:35 +0100 Subject: [PATCH 1/2] Check if bounding box available before read values --- src/parxy_core/drivers/llamaparse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parxy_core/drivers/llamaparse.py b/src/parxy_core/drivers/llamaparse.py index e62440d..464656d 100644 --- a/src/parxy_core/drivers/llamaparse.py +++ b/src/parxy_core/drivers/llamaparse.py @@ -482,12 +482,13 @@ def _convert_text_block(text_block: PageItem, page_number: int) -> TextBlock: TextBlock The converted `TextBlock` object. """ + ## Note: Bounding Box (bBox) can be None, it is still to be evaluated if that is a sign of hallucination or not bbox = BoundingBox( x0=text_block.bBox.x, y0=text_block.bBox.y, x1=text_block.bBox.x + text_block.bBox.w, y1=text_block.bBox.y + text_block.bBox.h, - ) + ) if text_block.bBox is not None else None # Handle empty page marker text_value = text_block.value if text_block.value else '' if text_value == 'NO_CONTENT_HERE': From 93fd86be06b49e32ccd9e493645d1d3b320ef505 Mon Sep 17 00:00:00 2001 From: avvertix <5672748+avvertix@users.noreply.github.com> Date: Fri, 6 Mar 2026 10:51:58 +0000 Subject: [PATCH 2/2] Fix styling --- src/parxy_core/drivers/llamaparse.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/parxy_core/drivers/llamaparse.py b/src/parxy_core/drivers/llamaparse.py index 464656d..ecd4ab3 100644 --- a/src/parxy_core/drivers/llamaparse.py +++ b/src/parxy_core/drivers/llamaparse.py @@ -483,12 +483,16 @@ def _convert_text_block(text_block: PageItem, page_number: int) -> TextBlock: The converted `TextBlock` object. """ ## Note: Bounding Box (bBox) can be None, it is still to be evaluated if that is a sign of hallucination or not - bbox = BoundingBox( - x0=text_block.bBox.x, - y0=text_block.bBox.y, - x1=text_block.bBox.x + text_block.bBox.w, - y1=text_block.bBox.y + text_block.bBox.h, - ) if text_block.bBox is not None else None + bbox = ( + BoundingBox( + x0=text_block.bBox.x, + y0=text_block.bBox.y, + x1=text_block.bBox.x + text_block.bBox.w, + y1=text_block.bBox.y + text_block.bBox.h, + ) + if text_block.bBox is not None + else None + ) # Handle empty page marker text_value = text_block.value if text_block.value else '' if text_value == 'NO_CONTENT_HERE':