Skip to content

Commit 77e38cd

Browse files
feat: [google-cloud-documentai] Added a field for enabling returning images and bounding boxes from layout parser processor (#13822)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 750248234 Source-Link: googleapis/googleapis@3bc2597 Source-Link: googleapis/googleapis-gen@fca4dd3 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6ImZjYTRkZDNjNmQ5ZTY1NTViODc5ODY3OTc1MjljNjdjZTllODA4NjcifQ== --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 4e07ac3 commit 77e38cd

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

packages/google-cloud-documentai/google/cloud/documentai_v1/types/document.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ class Document(proto.Message):
6666
representations use base64.
6767
6868
This field is a member of `oneof`_ ``source``.
69+
docid (str):
70+
Optional. An internal identifier for
71+
document. Should be loggable (no PII).
6972
mime_type (str):
7073
An IANA published `media type (MIME
7174
type) <https://www.iana.org/assignments/media-types/media-types.xhtml>`__.
@@ -1851,6 +1854,8 @@ class DocumentLayoutBlock(proto.Message):
18511854
ID of the block.
18521855
page_span (google.cloud.documentai_v1.types.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan):
18531856
Page span of the block.
1857+
bounding_box (google.cloud.documentai_v1.types.BoundingPoly):
1858+
Identifies the bounding box for the block.
18541859
"""
18551860

18561861
class LayoutPageSpan(proto.Message):
@@ -2050,6 +2055,11 @@ class LayoutListEntry(proto.Message):
20502055
number=5,
20512056
message="Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan",
20522057
)
2058+
bounding_box: geometry.BoundingPoly = proto.Field(
2059+
proto.MESSAGE,
2060+
number=6,
2061+
message=geometry.BoundingPoly,
2062+
)
20532063

20542064
blocks: MutableSequence[
20552065
"Document.DocumentLayout.DocumentLayoutBlock"
@@ -2192,6 +2202,10 @@ class ChunkPageFooter(proto.Message):
21922202
number=2,
21932203
oneof="source",
21942204
)
2205+
docid: str = proto.Field(
2206+
proto.STRING,
2207+
number=15,
2208+
)
21952209
mime_type: str = proto.Field(
21962210
proto.STRING,
21972211
number=3,

packages/google-cloud-documentai/google/cloud/documentai_v1/types/document_processor_service.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ class LayoutConfig(proto.Message):
135135
chunking_config (google.cloud.documentai_v1.types.ProcessOptions.LayoutConfig.ChunkingConfig):
136136
Optional. Config for chunking in layout
137137
parser processor.
138+
return_images (bool):
139+
Optional. Whether to include images in layout
140+
parser processor response.
141+
return_bounding_boxes (bool):
142+
Optional. Whether to include bounding boxes
143+
in layout parser processor response.
138144
"""
139145

140146
class ChunkingConfig(proto.Message):
@@ -163,6 +169,14 @@ class ChunkingConfig(proto.Message):
163169
number=1,
164170
message="ProcessOptions.LayoutConfig.ChunkingConfig",
165171
)
172+
return_images: bool = proto.Field(
173+
proto.BOOL,
174+
number=2,
175+
)
176+
return_bounding_boxes: bool = proto.Field(
177+
proto.BOOL,
178+
number=3,
179+
)
166180

167181
class IndividualPageSelector(proto.Message):
168182
r"""A list of individual page numbers.

0 commit comments

Comments
 (0)