Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.22.2

- Store routing in ElementMetadata

## 0.22.1

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion unstructured/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.22.1" # pragma: no cover
__version__ = "0.22.2" # pragma: no cover
10 changes: 10 additions & 0 deletions unstructured/documents/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ class ElementMetadata:
page_number: Optional[int]
parent_id: Optional[str]

# -- routing decision (page-level) --
routing: Optional[str]
routing_score: Optional[float]

# -- e-mail specific metadata fields --
bcc_recipient: Optional[list[str]]
cc_recipient: Optional[list[str]]
Expand Down Expand Up @@ -250,6 +254,8 @@ def __init__(
page_name: Optional[str] = None,
page_number: Optional[int] = None,
parent_id: Optional[str] = None,
routing: Optional[str] = None,
routing_score: Optional[float] = None,
sent_from: Optional[list[str]] = None,
sent_to: Optional[list[str]] = None,
signature: Optional[str] = None,
Expand Down Expand Up @@ -297,6 +303,8 @@ def __init__(
self.page_name = page_name
self.page_number = page_number
self.parent_id = parent_id
self.routing = routing
self.routing_score = routing_score
self.sent_from = sent_from
self.sent_to = sent_to
self.signature = signature
Expand Down Expand Up @@ -520,6 +528,8 @@ def field_consolidation_strategies(cls) -> dict[str, ConsolidationStrategy]:
"page_name": cls.FIRST,
"page_number": cls.FIRST,
"parent_id": cls.DROP,
"routing": cls.DROP,
"routing_score": cls.DROP,
"sent_from": cls.FIRST,
"sent_to": cls.FIRST,
"signature": cls.FIRST,
Expand Down
Loading