From a52bb88f78146a5777246d3fc04b04d0db1c1631 Mon Sep 17 00:00:00 2001 From: Christoph Auer <60343111+cau-git@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:59:38 +0100 Subject: [PATCH] fix: Restore proper string serialization of DocItemLabel (#124) * feat: Add mapping to colors into DocItemLabel Signed-off-by: Christoph Auer * fix: Restore DocItemLabel.__str__ Signed-off-by: Christoph Auer --------- Signed-off-by: Christoph Auer --- docling_core/types/doc/labels.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docling_core/types/doc/labels.py b/docling_core/types/doc/labels.py index 56d6398e..08c1f7c4 100644 --- a/docling_core/types/doc/labels.py +++ b/docling_core/types/doc/labels.py @@ -29,6 +29,10 @@ class DocItemLabel(str, Enum): PARAGRAPH = "paragraph" REFERENCE = "reference" + def __str__(self): + """Get string value.""" + return str(self.value) + @staticmethod def get_color(label: "DocItemLabel") -> Tuple[int, int, int]: """Return the RGB color associated with a given label."""