Skip to content

Commit 50a2632

Browse files
Google APIscopybara-github
authored andcommitted
feat: A new field signature_value is added to message .google.cloud.documentai.v1beta3.Document
feat: A new enum `Method` is added feat: A new field `method` is added to message `.google.cloud.documentai.v1beta3.Document` feat: A new field `annotations` is added to message `.google.cloud.documentai.v1beta3.Document` feat: A new field `annotations` is added to message `.google.cloud.documentai.v1beta3.Document` feat: A new message `EntityValidationOutput` is added feat: A new message `EntitiesRevision` is added feat: A new field `entity_validation_output` is added to message `.google.cloud.documentai.v1beta3.Document` feat: A new field `entities_revisions` is added to message `.google.cloud.documentai.v1beta3.Document` feat: A new field `entities_revision_id` is added to message `.google.cloud.documentai.v1beta3.Document` feat: A new enum `Method` is added feat: A new field `method` is added to message `.google.cloud.documentai.v1beta3.DocumentSchema` docs: A comment for field `training_method` in message `.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest` is changed docs: A comment for field `processor_version_source` in message `.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest` is changed docs: A comment for field `document_schema` in message `.google.cloud.documentai.v1beta3.ProcessorVersion` is changed docs: A comment for field `create_time` in message `.google.cloud.documentai.v1beta3.ProcessorVersion` is changed docs: A comment for field `latest_evaluation` in message `.google.cloud.documentai.v1beta3.ProcessorVersion` is changed docs: A comment for field `kms_key_name` in message `.google.cloud.documentai.v1beta3.ProcessorVersion` is changed docs: A comment for field `kms_key_version_name` in message `.google.cloud.documentai.v1beta3.ProcessorVersion` is changed docs: A comment for field `deprecation_info` in message `.google.cloud.documentai.v1beta3.ProcessorVersion` is changed docs: A comment for field `create_time` in message `.google.cloud.documentai.v1beta3.Processor` is changed PiperOrigin-RevId: 816756608
1 parent d06cf27 commit 50a2632

File tree

6 files changed

+140
-32
lines changed

6 files changed

+140
-32
lines changed

google/cloud/documentai/v1beta3/document.proto

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,10 @@ message Document {
588588

589589
// Float value.
590590
float float_value = 8;
591+
592+
// A signature - a graphical representation of a person's name,
593+
// often used to sign a document.
594+
bool signature_value = 10;
591595
}
592596

593597
// Optional. An optional field to store a normalized string.
@@ -604,6 +608,20 @@ message Document {
604608
string text = 1 [(google.api.field_behavior) = OPTIONAL];
605609
}
606610

611+
// Specifies how the entity's value is obtained.
612+
enum Method {
613+
// When the method is not specified, it should be treated as `EXTRACT`.
614+
METHOD_UNSPECIFIED = 0;
615+
616+
// The entity's value is directly extracted as-is from the document
617+
// text.
618+
EXTRACT = 1;
619+
620+
// The entity's value is derived through inference and is not
621+
// necessarily an exact text extraction from the document.
622+
DERIVE = 2;
623+
}
624+
607625
// Optional. Provenance of the entity.
608626
// Text anchor indexing into the
609627
// [Document.text][google.cloud.documentai.v1beta3.Document.text].
@@ -646,6 +664,9 @@ message Document {
646664
// Optional. Whether the entity will be redacted for de-identification
647665
// purposes.
648666
bool redacted = 12 [(google.api.field_behavior) = OPTIONAL];
667+
668+
// Optional. Specifies how the entity's value is obtained.
669+
Method method = 15 [(google.api.field_behavior) = OPTIONAL];
649670
}
650671

651672
// Relationship between
@@ -931,6 +952,9 @@ message Document {
931952
// A text block could further have child blocks.
932953
// Repeated blocks support further hierarchies and nested blocks.
933954
repeated DocumentLayoutBlock blocks = 3;
955+
956+
// Annotation of the text block.
957+
Annotations annotations = 4;
934958
}
935959

936960
// Represents a table type block.
@@ -943,6 +967,9 @@ message Document {
943967

944968
// Table caption/title.
945969
string caption = 3;
970+
971+
// Annotation of the table block.
972+
Annotations annotations = 4;
946973
}
947974

948975
// Represents a row in a table.
@@ -1155,6 +1182,62 @@ message Document {
11551182
string mime_type = 3;
11561183
}
11571184

1185+
// The output of the validation given the document and the validation rules.
1186+
message EntityValidationOutput {
1187+
// Validation result for a single validation rule.
1188+
message ValidationResult {
1189+
// The result of the validation rule.
1190+
enum ValidationResultType {
1191+
// The validation result type is unspecified.
1192+
VALIDATION_RESULT_TYPE_UNSPECIFIED = 0;
1193+
1194+
// The validation is valid.
1195+
VALIDATION_RESULT_TYPE_VALID = 1;
1196+
1197+
// The validation is invalid.
1198+
VALIDATION_RESULT_TYPE_INVALID = 2;
1199+
1200+
// The validation is skipped.
1201+
VALIDATION_RESULT_TYPE_SKIPPED = 3;
1202+
1203+
// The validation is not applicable.
1204+
VALIDATION_RESULT_TYPE_NOT_APPLICABLE = 4;
1205+
}
1206+
1207+
// The name of the validation rule.
1208+
string rule_name = 1;
1209+
1210+
// The description of the validation rule.
1211+
string rule_description = 2;
1212+
1213+
// The result of the validation rule.
1214+
ValidationResultType validation_result_type = 3;
1215+
1216+
// The detailed information of the running the validation process using
1217+
// the entity from the document based on the validation rule.
1218+
string validation_details = 4;
1219+
}
1220+
1221+
// The result of each validation rule.
1222+
repeated ValidationResult validation_results = 1;
1223+
1224+
// The overall result of the validation, true if all applicable rules are
1225+
// valid.
1226+
bool pass_all_rules = 2;
1227+
}
1228+
1229+
// Entity revision.
1230+
message EntitiesRevision {
1231+
// The revision id.
1232+
string revision_id = 1;
1233+
1234+
// The entities in this revision.
1235+
repeated Entity entities = 2;
1236+
1237+
// The entity validation output for this revision.
1238+
EntityValidationOutput entity_validation_output = 3;
1239+
}
1240+
11581241
// Original source document from the user.
11591242
oneof source {
11601243
// Optional. Currently supports Google Cloud Storage URI of the form
@@ -1222,6 +1305,22 @@ message Document {
12221305
// content of the inline blobs in this document, e.g. image bytes, such that
12231306
// it can be referenced by other fields in the document via asset id.
12241307
repeated BlobAsset blob_assets = 19 [(google.api.field_behavior) = OPTIONAL];
1308+
1309+
// The entity validation output for the document. This is the validation
1310+
// output for `document.entities` field.
1311+
EntityValidationOutput entity_validation_output = 21;
1312+
1313+
// A list of entity revisions. The entity revisions are appended to the
1314+
// document in the processing order. This field can be used for comparing the
1315+
// entity extraction results at different stages of the processing.
1316+
repeated EntitiesRevision entities_revisions = 22;
1317+
1318+
// The entity revision id that `document.entities` field is based on.
1319+
// If this field is set and `entities_revisions` is not empty, the entities in
1320+
// `document.entities` field are the entities in the entity revision with this
1321+
// id and `document.entity_validation_output` field is the
1322+
// `entity_validation_output` field in this entity revision.
1323+
string entities_revision_id = 23;
12251324
}
12261325

12271326
// The revision reference specifies which revision on the document to read.

google/cloud/documentai/v1beta3/document_processor_service.proto

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,8 +1098,8 @@ message TrainProcessorVersionRequest {
10981098
TEMPLATE_BASED = 2;
10991099
}
11001100

1101-
// Training method to use for CDE training.
1102-
TrainingMethod training_method = 3;
1101+
// Optional. Training method to use for CDE training.
1102+
TrainingMethod training_method = 3 [(google.api.field_behavior) = OPTIONAL];
11031103
}
11041104

11051105
// Options to control foundation model tuning of the processor.
@@ -1419,8 +1419,6 @@ message ImportProcessorVersionRequest {
14191419
oneof source {
14201420
// The source processor version to import from. The source processor version
14211421
// and destination processor need to be in the same environment and region.
1422-
// Note that ProcessorVersions with `model_type` `MODEL_TYPE_LLM` are not
1423-
// supported.
14241422
string processor_version_source = 2 [(google.api.resource_reference) = {
14251423
type: "documentai.googleapis.com/ProcessorVersion"
14261424
}];

google/cloud/documentai/v1beta3/document_schema.proto

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,20 @@ message DocumentSchema {
123123
REQUIRED_MULTIPLE = 4;
124124
}
125125

126+
// Specifies how the entity's value is obtained from the document.
127+
enum Method {
128+
// Unspecified method. It defaults to `EXTRACT`.
129+
METHOD_UNSPECIFIED = 0;
130+
131+
// The entity's value is directly extracted as-is from the document
132+
// text.
133+
EXTRACT = 1;
134+
135+
// The entity's value is derived through inference and is not
136+
// necessarily an exact text extraction from the document.
137+
DERIVE = 2;
138+
}
139+
126140
// The name of the property. Follows the same guidelines as the
127141
// EntityType name.
128142
string name = 1;
@@ -142,6 +156,9 @@ message DocumentSchema {
142156
// in the document.
143157
OccurrenceType occurrence_type = 3;
144158

159+
// Specifies how the entity's value is obtained.
160+
Method method = 8;
161+
145162
// Any additional metadata about the property can be added here.
146163
PropertyMetadata property_metadata = 5;
147164
}

google/cloud/documentai/v1beta3/documentai_v1beta3.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,8 @@ publishing:
105105
organization: CLOUD
106106
library_settings:
107107
- version: google.cloud.documentai.v1beta3
108-
java_settings:
109-
common: {}
110-
cpp_settings:
111-
common: {}
112-
php_settings:
113-
common: {}
114-
python_settings:
115-
common: {}
116-
node_settings:
117-
common: {}
118108
dotnet_settings:
119109
common: {}
120110
ignored_resources:
121111
- documentai.googleapis.com/Location
122-
ruby_settings:
123-
common: {}
124-
go_settings:
125-
common: {}
126112
proto_reference_documentation_uri: https://cloud.google.com/document-ai/docs/reference/rpc

google/cloud/documentai/v1beta3/evaluation.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ syntax = "proto3";
1616

1717
package google.cloud.documentai.v1beta3;
1818

19+
import "google/api/field_behavior.proto";
1920
import "google/api/resource.proto";
2021
import "google/protobuf/timestamp.proto";
2122

google/cloud/documentai/v1beta3/processor.proto

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148,29 +148,35 @@ message ProcessorVersion {
148148
// The display name of the processor version.
149149
string display_name = 2;
150150

151-
// The schema of the processor version. Describes the output.
152-
DocumentSchema document_schema = 12;
151+
// Output only. The schema of the processor version. Describes the output.
152+
DocumentSchema document_schema = 12
153+
[(google.api.field_behavior) = OUTPUT_ONLY];
153154

154155
// Output only. The state of the processor version.
155156
State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
156157

157-
// The time the processor version was created.
158-
google.protobuf.Timestamp create_time = 7;
158+
// Output only. The time the processor version was created.
159+
google.protobuf.Timestamp create_time = 7
160+
[(google.api.field_behavior) = OUTPUT_ONLY];
159161

160-
// The most recently invoked evaluation for the processor version.
161-
EvaluationReference latest_evaluation = 8;
162+
// Output only. The most recently invoked evaluation for the processor
163+
// version.
164+
EvaluationReference latest_evaluation = 8
165+
[(google.api.field_behavior) = OUTPUT_ONLY];
162166

163-
// The KMS key name used for encryption.
164-
string kms_key_name = 9;
167+
// Output only. The KMS key name used for encryption.
168+
string kms_key_name = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
165169

166-
// The KMS key version with which data is encrypted.
167-
string kms_key_version_name = 10;
170+
// Output only. The KMS key version with which data is encrypted.
171+
string kms_key_version_name = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
168172

169173
// Output only. Denotes that this `ProcessorVersion` is managed by Google.
170174
bool google_managed = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
171175

172-
// If set, information about the eventual deprecation of this version.
173-
DeprecationInfo deprecation_info = 13;
176+
// Output only. If set, information about the eventual deprecation of this
177+
// version.
178+
DeprecationInfo deprecation_info = 13
179+
[(google.api.field_behavior) = OUTPUT_ONLY];
174180

175181
// Output only. The model type of this processor version.
176182
ModelType model_type = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -275,8 +281,9 @@ message Processor {
275281
(google.api.field_behavior) = IMMUTABLE
276282
];
277283

278-
// The time the processor was created.
279-
google.protobuf.Timestamp create_time = 7;
284+
// Output only. The time the processor was created.
285+
google.protobuf.Timestamp create_time = 7
286+
[(google.api.field_behavior) = OUTPUT_ONLY];
280287

281288
// The [KMS key](https://cloud.google.com/security-key-management) used for
282289
// encryption and decryption in CMEK scenarios.

0 commit comments

Comments
 (0)