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
Original file line number Diff line number Diff line change
Expand Up @@ -1961,7 +1961,9 @@ async def sample_create_processor():
processor (:class:`google.cloud.documentai_v1.types.Processor`):
Required. The processor to be created, requires
[Processor.type][google.cloud.documentai.v1.Processor.type]
and [Processor.display_name]][] to be set. Also, the
and
[Processor.display_name][google.cloud.documentai.v1.Processor.display_name]
to be set. Also, the
[Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
field must be set if the processor is under CMEK.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,9 @@ def sample_create_processor():
processor (google.cloud.documentai_v1.types.Processor):
Required. The processor to be created, requires
[Processor.type][google.cloud.documentai.v1.Processor.type]
and [Processor.display_name]][] to be set. Also, the
and
[Processor.display_name][google.cloud.documentai.v1.Processor.display_name]
to be set. Also, the
[Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
field must be set if the processor is under CMEK.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1486,8 +1486,10 @@ class PageRef(proto.Message):
[PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]
instead.
bounding_poly (google.cloud.documentai_v1.types.BoundingPoly):
Optional. Identifies the bounding polygon of
a layout element on the page.
Optional. Identifies the bounding polygon of a layout
element on the page. If ``layout_type`` is set, the bounding
polygon must be exactly the same to the layout element it's
referring to.
confidence (float):
Optional. Confidence of detected page element, if
applicable. Range ``[0, 1]``.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,16 @@ class ProcessOptions(proto.Message):

This field is a member of `oneof`_ ``page_range``.
ocr_config (google.cloud.documentai_v1.types.OcrConfig):
Only applicable to ``OCR_PROCESSOR``. Returns error if set
on other processor types.
Only applicable to ``OCR_PROCESSOR`` and
``FORM_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].
Will return an Invalid Argument error if this field is set
when the underlying
[ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
doesn't support schema override.
"""

class IndividualPageSelector(proto.Message):
Expand Down Expand Up @@ -152,6 +160,11 @@ class IndividualPageSelector(proto.Message):
number=1,
message=document_io.OcrConfig,
)
schema_override: gcd_document_schema.DocumentSchema = proto.Field(
proto.MESSAGE,
number=8,
message=gcd_document_schema.DocumentSchema,
)


class ProcessRequest(proto.Message):
Expand Down Expand Up @@ -202,6 +215,15 @@ class ProcessRequest(proto.Message):
``pages.{page_field_name}``.
process_options (google.cloud.documentai_v1.types.ProcessOptions):
Inference-time options for the process API
labels (MutableMapping[str, str]):
Optional. The labels with user-defined
metadata for the request.
Label keys and values can be no longer than 63
characters (Unicode codepoints) and can only
contain lowercase letters, numeric characters,
underscores, and dashes. International
characters are allowed. Label values are
optional. Label keys must start with a letter.
"""

inline_document: gcd_document.Document = proto.Field(
Expand Down Expand Up @@ -240,6 +262,11 @@ class ProcessRequest(proto.Message):
number=7,
message="ProcessOptions",
)
labels: MutableMapping[str, str] = proto.MapField(
proto.STRING,
proto.STRING,
number=10,
)


class HumanReviewStatus(proto.Message):
Expand Down Expand Up @@ -357,6 +384,15 @@ class BatchProcessRequest(proto.Message):
Default to ``false``.
process_options (google.cloud.documentai_v1.types.ProcessOptions):
Inference-time options for the process API
labels (MutableMapping[str, str]):
Optional. The labels with user-defined
metadata for the request.
Label keys and values can be no longer than 63
characters (Unicode codepoints) and can only
contain lowercase letters, numeric characters,
underscores, and dashes. International
characters are allowed. Label values are
optional. Label keys must start with a letter.
"""

name: str = proto.Field(
Expand All @@ -382,6 +418,11 @@ class BatchProcessRequest(proto.Message):
number=7,
message="ProcessOptions",
)
labels: MutableMapping[str, str] = proto.MapField(
proto.STRING,
proto.STRING,
number=9,
)


class BatchProcessResponse(proto.Message):
Expand Down Expand Up @@ -917,7 +958,9 @@ class CreateProcessorRequest(proto.Message):
processor (google.cloud.documentai_v1.types.Processor):
Required. The processor to be created, requires
[Processor.type][google.cloud.documentai.v1.Processor.type]
and [Processor.display_name]][] to be set. Also, the
and
[Processor.display_name][google.cloud.documentai.v1.Processor.display_name]
to be set. Also, the
[Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
field must be set if the processor is under CMEK.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ class Property(proto.Message):
name (str):
The name of the property. Follows the same
guidelines as the EntityType name.
display_name (str):
User defined name for the property.
value_type (str):
A reference to the value type of the property. This type is
subject to the same conventions as the ``Entity.base_types``
Expand All @@ -119,14 +121,14 @@ class Property(proto.Message):

class OccurrenceType(proto.Enum):
r"""Types of occurrences of the entity type in the document. This
represents the number of instances of an entity, not number of
mentions of an entity. For example, a bank statement may only have
one ``account_number``, but this account number may be mentioned in
several places on the document. In this case the 'account_number'
would be considered a ``REQUIRED_ONCE`` entity type. If, on the
other hand, we expect a bank statement to contain the status of
multiple different accounts for the customers, the occurrence type
will be set to ``REQUIRED_MULTIPLE``.
represents the number of instances, not mentions, of an entity. For
example, a bank statement might only have one ``account_number``,
but this account number can be mentioned in several places on the
document. In this case, the ``account_number`` is considered a
``REQUIRED_ONCE`` entity type. If, on the other hand, we expect a
bank statement to contain the status of multiple different accounts
for the customers, the occurrence type is set to
``REQUIRED_MULTIPLE``.

Values:
OCCURRENCE_TYPE_UNSPECIFIED (0):
Expand Down Expand Up @@ -156,6 +158,10 @@ class OccurrenceType(proto.Enum):
proto.STRING,
number=1,
)
display_name: str = proto.Field(
proto.STRING,
number=6,
)
value_type: str = proto.Field(
proto.STRING,
number=2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def partition(
class documentaiCallTransformer(cst.CSTTransformer):
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
'batch_process_documents': ('name', 'input_documents', 'document_output_config', 'skip_human_review', 'process_options', ),
'batch_process_documents': ('name', 'input_documents', 'document_output_config', 'skip_human_review', 'process_options', 'labels', ),
'create_processor': ('parent', 'processor', ),
'delete_processor': ('name', ),
'delete_processor_version': ('name', ),
Expand All @@ -56,7 +56,7 @@ class documentaiCallTransformer(cst.CSTTransformer):
'list_processors': ('parent', 'page_size', 'page_token', ),
'list_processor_types': ('parent', 'page_size', 'page_token', ),
'list_processor_versions': ('parent', 'page_size', 'page_token', ),
'process_document': ('name', 'inline_document', 'raw_document', 'gcs_document', 'skip_human_review', 'field_mask', 'process_options', ),
'process_document': ('name', 'inline_document', 'raw_document', 'gcs_document', 'skip_human_review', 'field_mask', 'process_options', 'labels', ),
'review_document': ('human_review_config', 'inline_document', 'enable_schema_validation', 'priority', 'document_schema', ),
'set_default_processor_version': ('processor', 'default_processor_version', ),
'train_processor_version': ('parent', 'processor_version', 'custom_document_extraction_options', 'document_schema', 'input_data', 'base_processor_version', ),
Expand Down