Skip to content

Commit 9a9bc9b

Browse files
Google APIscopybara-github
authored andcommitted
feat: A new field schema_override is added to message ProcessOptions
feat: A new field `labels` is added to messages `ProcessRequest` and `BatchProcessRequest` feat: A new field `display_name` is added to message `DocumentSchema` docs: updated comments PiperOrigin-RevId: 607148983
1 parent b084e51 commit 9a9bc9b

3 files changed

Lines changed: 37 additions & 9 deletions

File tree

google/cloud/documentai/v1/document.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,8 @@ message Document {
754754
[deprecated = true, (google.api.field_behavior) = OPTIONAL];
755755

756756
// Optional. Identifies the bounding polygon of a layout element on the
757-
// page.
757+
// page. If `layout_type` is set, the bounding polygon must be exactly the
758+
// same to the layout element it's referring to.
758759
BoundingPoly bounding_poly = 4 [(google.api.field_behavior) = OPTIONAL];
759760

760761
// Optional. Confidence of detected page element, if applicable. Range

google/cloud/documentai/v1/document_processor_service.proto

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,16 @@ message ProcessOptions {
352352
int32 from_end = 7;
353353
}
354354

355-
// Only applicable to `OCR_PROCESSOR`. Returns error if set on other
356-
// processor types.
355+
// Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`.
356+
// Returns error if set on other processor types.
357357
OcrConfig ocr_config = 1;
358+
359+
// Optional. Override the schema of the
360+
// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will
361+
// return an Invalid Argument error if this field is set when the underlying
362+
// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't
363+
// support schema override.
364+
DocumentSchema schema_override = 8 [(google.api.field_behavior) = OPTIONAL];
358365
}
359366

360367
// Request message for the
@@ -400,6 +407,14 @@ message ProcessRequest {
400407

401408
// Inference-time options for the process API
402409
ProcessOptions process_options = 7;
410+
411+
// Optional. The labels with user-defined metadata for the request.
412+
//
413+
// Label keys and values can be no longer than 63 characters
414+
// (Unicode codepoints) and can only contain lowercase letters, numeric
415+
// characters, underscores, and dashes. International characters are allowed.
416+
// Label values are optional. Label keys must start with a letter.
417+
map<string, string> labels = 10 [(google.api.field_behavior) = OPTIONAL];
403418
}
404419

405420
// The status of human review on a processed document.
@@ -483,6 +498,14 @@ message BatchProcessRequest {
483498

484499
// Inference-time options for the process API
485500
ProcessOptions process_options = 7;
501+
502+
// Optional. The labels with user-defined metadata for the request.
503+
//
504+
// Label keys and values can be no longer than 63 characters
505+
// (Unicode codepoints) and can only contain lowercase letters, numeric
506+
// characters, underscores, and dashes. International characters are allowed.
507+
// Label values are optional. Label keys must start with a letter.
508+
map<string, string> labels = 9 [(google.api.field_behavior) = OPTIONAL];
486509
}
487510

488511
// Response message for
@@ -803,7 +826,8 @@ message CreateProcessorRequest {
803826

804827
// Required. The processor to be created, requires
805828
// [Processor.type][google.cloud.documentai.v1.Processor.type] and
806-
// [Processor.display_name]][] to be set. Also, the
829+
// [Processor.display_name][google.cloud.documentai.v1.Processor.display_name]
830+
// to be set. Also, the
807831
// [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
808832
// field must be set if the processor is under CMEK.
809833
Processor processor = 2 [(google.api.field_behavior) = REQUIRED];

google/cloud/documentai/v1/document_schema.proto

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ message DocumentSchema {
3939
// Defines properties that can be part of the entity type.
4040
message Property {
4141
// Types of occurrences of the entity type in the document. This
42-
// represents the number of instances of an entity, not number of mentions
43-
// of an entity. For example, a bank statement may only have one
44-
// `account_number`, but this account number may be mentioned in several
45-
// places on the document. In this case the 'account_number' would be
42+
// represents the number of instances, not mentions, of an entity.
43+
// For example, a bank statement might only have one
44+
// `account_number`, but this account number can be mentioned in several
45+
// places on the document. In this case, the `account_number` is
4646
// considered a `REQUIRED_ONCE` entity type. If, on the other hand, we
4747
// expect a bank statement to contain the status of multiple different
48-
// accounts for the customers, the occurrence type will be set to
48+
// accounts for the customers, the occurrence type is set to
4949
// `REQUIRED_MULTIPLE`.
5050
enum OccurrenceType {
5151
// Unspecified occurrence type.
@@ -70,6 +70,9 @@ message DocumentSchema {
7070
// EntityType name.
7171
string name = 1;
7272

73+
// User defined name for the property.
74+
string display_name = 6;
75+
7376
// A reference to the value type of the property. This type is subject
7477
// to the same conventions as the `Entity.base_types` field.
7578
string value_type = 2;

0 commit comments

Comments
 (0)