Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit f374763

Browse files
feat: Added EvaluationReference to evaluation.proto (#454)
* feat: Added EvaluationReference to evaluation.proto feat: Added latest_evaluation to processor.proto chore!: Updated TrainProcessorVersion parent to correctly be a Processor, rather than ProcessorVersion BREAKING CHANGE: The TrainProcessorVersion parent was incorrectly annotated. PiperOrigin-RevId: 507577968 Source-Link: googleapis/googleapis@a2cdee8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/68cd7fe32bd4387195a27b605b032ca1f5071222 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjhjZDdmZTMyYmQ0Mzg3MTk1YTI3YjYwNWIwMzJjYTFmNTA3MTIyMiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent b767a64 commit f374763

File tree

8 files changed

+77
-14
lines changed

8 files changed

+77
-14
lines changed

google/cloud/documentai_v1beta3/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
UndeployProcessorVersionResponse,
8787
)
8888
from .types.document_schema import DocumentSchema
89-
from .types.evaluation import Evaluation
89+
from .types.evaluation import Evaluation, EvaluationReference
9090
from .types.geometry import BoundingPoly, NormalizedVertex, Vertex
9191
from .types.operation_metadata import CommonOperationMetadata
9292
from .types.processor import Processor, ProcessorVersion
@@ -123,6 +123,7 @@
123123
"EvaluateProcessorVersionRequest",
124124
"EvaluateProcessorVersionResponse",
125125
"Evaluation",
126+
"EvaluationReference",
126127
"FetchProcessorTypesRequest",
127128
"FetchProcessorTypesResponse",
128129
"GcsDocument",

google/cloud/documentai_v1beta3/types/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
UndeployProcessorVersionResponse,
7878
)
7979
from .document_schema import DocumentSchema
80-
from .evaluation import Evaluation
80+
from .evaluation import Evaluation, EvaluationReference
8181
from .geometry import BoundingPoly, NormalizedVertex, Vertex
8282
from .operation_metadata import CommonOperationMetadata
8383
from .processor import Processor, ProcessorVersion
@@ -145,6 +145,7 @@
145145
"UndeployProcessorVersionResponse",
146146
"DocumentSchema",
147147
"Evaluation",
148+
"EvaluationReference",
148149
"BoundingPoly",
149150
"NormalizedVertex",
150151
"Vertex",

google/cloud/documentai_v1beta3/types/document.py

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,20 +1481,30 @@ class OperationType(proto.Enum):
14811481
Add an element.
14821482
REMOVE (2):
14831483
Remove an element identified by ``parent``.
1484+
UPDATE (7):
1485+
Updates any fields within the given
1486+
provenance scope of the message. It 'overwrites'
1487+
the fields rather than replacing them. This is
1488+
especially relevant when we just want to update
1489+
a field value of an entity without also
1490+
affecting all the child properties.
14841491
REPLACE (3):
1485-
Replace an element identified by ``parent``.
1486-
EVAL_REQUESTED (4):
1487-
Request human review for the element identified by
1492+
Currently unused. Replace an element identified by
14881493
``parent``.
1494+
EVAL_REQUESTED (4):
1495+
Deprecated. Request human review for the element identified
1496+
by ``parent``.
14891497
EVAL_APPROVED (5):
1490-
Element is reviewed and approved at human
1491-
review, confidence will be set to 1.0.
1498+
Deprecated. Element is reviewed and approved
1499+
at human review, confidence will be set to 1.0.
14921500
EVAL_SKIPPED (6):
1493-
Element is skipped in the validation process.
1501+
Deprecated. Element is skipped in the
1502+
validation process.
14941503
"""
14951504
OPERATION_TYPE_UNSPECIFIED = 0
14961505
ADD = 1
14971506
REMOVE = 2
1507+
UPDATE = 7
14981508
REPLACE = 3
14991509
EVAL_REQUESTED = 4
15001510
EVAL_APPROVED = 5
@@ -1571,8 +1581,9 @@ class Revision(proto.Message):
15711581
15721582
This field is a member of `oneof`_ ``source``.
15731583
id (str):
1574-
Id of the revision. Unique within the
1575-
context of the document.
1584+
Id of the revision, internally generated by
1585+
doc proto storage. Unique within the context of
1586+
the document.
15761587
parent (MutableSequence[int]):
15771588
The revisions that this revision is based on. This can
15781589
include one or more parent (when documents are merged.) This
@@ -1583,7 +1594,9 @@ class Revision(proto.Message):
15831594
eg. there are ``provenance.parent.revision`` fields that
15841595
index into this field.
15851596
create_time (google.protobuf.timestamp_pb2.Timestamp):
1586-
The time that the revision was created.
1597+
The time that the revision was created,
1598+
internally generated by doc proto storage at the
1599+
time of create.
15871600
human_review (google.cloud.documentai_v1beta3.types.Document.Revision.HumanReview):
15881601
Human Review information of this revision.
15891602
"""

google/cloud/documentai_v1beta3/types/evaluation.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,50 @@
2121
__protobuf__ = proto.module(
2222
package="google.cloud.documentai.v1beta3",
2323
manifest={
24+
"EvaluationReference",
2425
"Evaluation",
2526
},
2627
)
2728

2829

30+
class EvaluationReference(proto.Message):
31+
r"""Gives a short summary of an evaluation, and links to the
32+
evaluation itself.
33+
34+
Attributes:
35+
operation (str):
36+
The resource name of the Long Running
37+
Operation for the evaluation.
38+
evaluation (str):
39+
The resource name of the evaluation.
40+
aggregate_metrics (google.cloud.documentai_v1beta3.types.Evaluation.Metrics):
41+
An aggregate of the statistics for the
42+
evaluation with fuzzy matching on.
43+
aggregate_metrics_exact (google.cloud.documentai_v1beta3.types.Evaluation.Metrics):
44+
An aggregate of the statistics for the
45+
evaluation with fuzzy matching off.
46+
"""
47+
48+
operation: str = proto.Field(
49+
proto.STRING,
50+
number=1,
51+
)
52+
evaluation: str = proto.Field(
53+
proto.STRING,
54+
number=2,
55+
)
56+
aggregate_metrics: "Evaluation.Metrics" = proto.Field(
57+
proto.MESSAGE,
58+
number=4,
59+
message="Evaluation.Metrics",
60+
)
61+
aggregate_metrics_exact: "Evaluation.Metrics" = proto.Field(
62+
proto.MESSAGE,
63+
number=5,
64+
message="Evaluation.Metrics",
65+
)
66+
67+
2968
class Evaluation(proto.Message):
3069
r"""An evaluation of a ProcessorVersion's performance.
3170

google/cloud/documentai_v1beta3/types/processor.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import proto # type: ignore
2020

2121
from google.cloud.documentai_v1beta3.types import document_schema as gcd_document_schema
22+
from google.cloud.documentai_v1beta3.types import evaluation
2223

2324
__protobuf__ = proto.module(
2425
package="google.cloud.documentai.v1beta3",
@@ -50,6 +51,9 @@ class ProcessorVersion(proto.Message):
5051
The state of the processor version.
5152
create_time (google.protobuf.timestamp_pb2.Timestamp):
5253
The time the processor version was created.
54+
latest_evaluation (google.cloud.documentai_v1beta3.types.EvaluationReference):
55+
The most recently invoked evaluation for the
56+
processor version.
5357
kms_key_name (str):
5458
The KMS key name used for encryption.
5559
kms_key_version_name (str):
@@ -143,6 +147,11 @@ class DeprecationInfo(proto.Message):
143147
number=7,
144148
message=timestamp_pb2.Timestamp,
145149
)
150+
latest_evaluation: evaluation.EvaluationReference = proto.Field(
151+
proto.MESSAGE,
152+
number=8,
153+
message=evaluation.EvaluationReference,
154+
)
146155
kms_key_name: str = proto.Field(
147156
proto.STRING,
148157
number=9,

samples/generated_samples/snippet_metadata_google.cloud.documentai.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-documentai",
11-
"version": "2.10.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-documentai",
11-
"version": "2.10.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-documentai",
11-
"version": "2.10.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)