Skip to content

Commit 6429996

Browse files
Google APIscopybara-github
authored andcommitted
feat: Added config options for derived fields and signature detection. Some annotation changes changes to mark fields explicitly output only (no changes in semantics just readability)
docs: A comment for field `document_schema` in message `.google.cloud.documentai.v1.ProcessorVersion` is changed to describe as output only. docs: A comment for field `create_time` in message `.google.cloud.documentai.v1.ProcessorVersion` is changed to describe as output only. docs: A comment for field `latest_evaluation` in message `.google.cloud.documentai.v1.ProcessorVersion` is changed to describe as output only. docs: A comment for field `kms_key_name` in message `.google.cloud.documentai.v1.ProcessorVersion` is changed to describe as output only. docs: A comment for field `kms_key_version_name` in message `.google.cloud.documentai.v1.ProcessorVersion` is changed to describe as output only. docs: A comment for field `deprecation_info` in message `.google.cloud.documentai.v1.ProcessorVersion` is changed to describe as output only. docs: A comment for field `create_time` in message `.google.cloud.documentai.v1.Processor` is changed to describe as output only. PiperOrigin-RevId: 795630471
1 parent 6388d14 commit 6429996

File tree

5 files changed

+59
-14
lines changed

5 files changed

+59
-14
lines changed

google/cloud/documentai/v1/document.proto

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,8 @@ message Document {
585585

586586
// Float value.
587587
float float_value = 8;
588+
589+
bool signature_value = 10;
588590
}
589591

590592
// Optional. An optional field to store a normalized string.
@@ -601,6 +603,20 @@ message Document {
601603
string text = 1 [(google.api.field_behavior) = OPTIONAL];
602604
}
603605

606+
// Specifies how the entity's value is obtained.
607+
enum Method {
608+
// When the method is not specified, it should be treated as `EXTRACT`.
609+
METHOD_UNSPECIFIED = 0;
610+
611+
// The entity's value is directly extracted as-is from the document
612+
// text.
613+
EXTRACT = 1;
614+
615+
// The entity's value is derived through inference and is not
616+
// necessarily an exact text extraction from the document.
617+
DERIVE = 2;
618+
}
619+
604620
// Optional. Provenance of the entity.
605621
// Text anchor indexing into the
606622
// [Document.text][google.cloud.documentai.v1.Document.text].
@@ -643,6 +659,9 @@ message Document {
643659
// Optional. Whether the entity will be redacted for de-identification
644660
// purposes.
645661
bool redacted = 12 [(google.api.field_behavior) = OPTIONAL];
662+
663+
// Optional. Specifies how the entity's value is obtained.
664+
Method method = 15 [(google.api.field_behavior) = OPTIONAL];
646665
}
647666

648667
// Relationship between

google/cloud/documentai/v1/document_schema.proto

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,20 @@ message DocumentSchema {
6666
REQUIRED_MULTIPLE = 4;
6767
}
6868

69+
// Specifies how the entity's value is obtained from the document.
70+
enum Method {
71+
// Unspecified method. It defaults to `EXTRACT`.
72+
METHOD_UNSPECIFIED = 0;
73+
74+
// The entity's value is directly extracted as-is from the document
75+
// text.
76+
EXTRACT = 1;
77+
78+
// The entity's value is derived through inference and is not
79+
// necessarily an exact text extraction from the document.
80+
DERIVE = 2;
81+
}
82+
6983
// The name of the property. Follows the same guidelines as the
7084
// EntityType name.
7185
string name = 1;
@@ -80,6 +94,9 @@ message DocumentSchema {
8094
// Occurrence type limits the number of instances an entity type appears
8195
// in the document.
8296
OccurrenceType occurrence_type = 3;
97+
98+
// Specifies how the entity's value is obtained.
99+
Method method = 8;
83100
}
84101

85102
oneof value_source {

google/cloud/documentai/v1/documentai_v1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ publishing:
9494
library_settings:
9595
- version: google.cloud.documentai.v1
9696
dotnet_settings:
97+
common: {}
9798
ignored_resources:
9899
- documentai.googleapis.com/Location
99100
proto_reference_documentation_uri: https://cloud.google.com/document-ai/docs/reference/rpc

google/cloud/documentai/v1/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.v1;
1818

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

google/cloud/documentai/v1/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)