Skip to content

Commit a52bb88

Browse files
authored
fix: Restore proper string serialization of DocItemLabel (#124)
* feat: Add mapping to colors into DocItemLabel Signed-off-by: Christoph Auer <[email protected]> * fix: Restore DocItemLabel.__str__ Signed-off-by: Christoph Auer <[email protected]> --------- Signed-off-by: Christoph Auer <[email protected]>
1 parent 5c2e0de commit a52bb88

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docling_core/types/doc/labels.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ class DocItemLabel(str, Enum):
2929
PARAGRAPH = "paragraph"
3030
REFERENCE = "reference"
3131

32+
def __str__(self):
33+
"""Get string value."""
34+
return str(self.value)
35+
3236
@staticmethod
3337
def get_color(label: "DocItemLabel") -> Tuple[int, int, int]:
3438
"""Return the RGB color associated with a given label."""

0 commit comments

Comments
 (0)