Skip to content

Commit

Permalink
feat: [google-cloud-documentai] Make Layout Parser generally availabl…
Browse files Browse the repository at this point in the history
…e in V1 (#12762)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 638924855

Source-Link:
googleapis/googleapis@0cea717

Source-Link:
googleapis/googleapis-gen@ba9bd19
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6ImJhOWJkMTlhNjc4N2I2YmUxNzUwYjE4MTU3YjMwNDY3YThjZTY3MzAifQ==

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jun 3, 2024
1 parent 5c4c658 commit 9fd16ad
Showing 1 changed file with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ class ProcessOptions(proto.Message):
Only applicable to ``OCR_PROCESSOR`` and
``FORM_PARSER_PROCESSOR``. Returns error if set on other
processor types.
layout_config (google.cloud.documentai_v1.types.ProcessOptions.LayoutConfig):
Optional. Only applicable to ``LAYOUT_PARSER_PROCESSOR``.
Returns error if set on other processor types.
schema_override (google.cloud.documentai_v1.types.DocumentSchema):
Optional. Override the schema of the
[ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
Expand All @@ -125,6 +128,42 @@ class ProcessOptions(proto.Message):
doesn't support schema override.
"""

class LayoutConfig(proto.Message):
r"""Serving config for layout parser processor.
Attributes:
chunking_config (google.cloud.documentai_v1.types.ProcessOptions.LayoutConfig.ChunkingConfig):
Optional. Config for chunking in layout
parser processor.
"""

class ChunkingConfig(proto.Message):
r"""Serving config for chunking.
Attributes:
chunk_size (int):
Optional. The chunk sizes to use when
splitting documents, in order of level.
include_ancestor_headings (bool):
Optional. Whether or not to include ancestor
headings when splitting.
"""

chunk_size: int = proto.Field(
proto.INT32,
number=1,
)
include_ancestor_headings: bool = proto.Field(
proto.BOOL,
number=2,
)

chunking_config: "ProcessOptions.LayoutConfig.ChunkingConfig" = proto.Field(
proto.MESSAGE,
number=1,
message="ProcessOptions.LayoutConfig.ChunkingConfig",
)

class IndividualPageSelector(proto.Message):
r"""A list of individual page numbers.
Expand Down Expand Up @@ -160,6 +199,11 @@ class IndividualPageSelector(proto.Message):
number=1,
message=document_io.OcrConfig,
)
layout_config: LayoutConfig = proto.Field(
proto.MESSAGE,
number=9,
message=LayoutConfig,
)
schema_override: gcd_document_schema.DocumentSchema = proto.Field(
proto.MESSAGE,
number=8,
Expand Down

0 comments on commit 9fd16ad

Please sign in to comment.