Skip to content

Commit

Permalink
feat: Added EvaluationReference to evaluation.proto (#454)
Browse files Browse the repository at this point in the history
* 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: googleapis/googleapis-gen@68cd7fe
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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Feb 7, 2023
1 parent 488564d commit 0b5894e
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
UndeployProcessorVersionResponse,
)
from .types.document_schema import DocumentSchema
from .types.evaluation import Evaluation
from .types.evaluation import Evaluation, EvaluationReference
from .types.geometry import BoundingPoly, NormalizedVertex, Vertex
from .types.operation_metadata import CommonOperationMetadata
from .types.processor import Processor, ProcessorVersion
Expand Down Expand Up @@ -123,6 +123,7 @@
"EvaluateProcessorVersionRequest",
"EvaluateProcessorVersionResponse",
"Evaluation",
"EvaluationReference",
"FetchProcessorTypesRequest",
"FetchProcessorTypesResponse",
"GcsDocument",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
UndeployProcessorVersionResponse,
)
from .document_schema import DocumentSchema
from .evaluation import Evaluation
from .evaluation import Evaluation, EvaluationReference
from .geometry import BoundingPoly, NormalizedVertex, Vertex
from .operation_metadata import CommonOperationMetadata
from .processor import Processor, ProcessorVersion
Expand Down Expand Up @@ -145,6 +145,7 @@
"UndeployProcessorVersionResponse",
"DocumentSchema",
"Evaluation",
"EvaluationReference",
"BoundingPoly",
"NormalizedVertex",
"Vertex",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1481,20 +1481,30 @@ class OperationType(proto.Enum):
Add an element.
REMOVE (2):
Remove an element identified by ``parent``.
UPDATE (7):
Updates any fields within the given
provenance scope of the message. It 'overwrites'
the fields rather than replacing them. This is
especially relevant when we just want to update
a field value of an entity without also
affecting all the child properties.
REPLACE (3):
Replace an element identified by ``parent``.
EVAL_REQUESTED (4):
Request human review for the element identified by
Currently unused. Replace an element identified by
``parent``.
EVAL_REQUESTED (4):
Deprecated. Request human review for the element identified
by ``parent``.
EVAL_APPROVED (5):
Element is reviewed and approved at human
review, confidence will be set to 1.0.
Deprecated. Element is reviewed and approved
at human review, confidence will be set to 1.0.
EVAL_SKIPPED (6):
Element is skipped in the validation process.
Deprecated. Element is skipped in the
validation process.
"""
OPERATION_TYPE_UNSPECIFIED = 0
ADD = 1
REMOVE = 2
UPDATE = 7
REPLACE = 3
EVAL_REQUESTED = 4
EVAL_APPROVED = 5
Expand Down Expand Up @@ -1571,8 +1581,9 @@ class Revision(proto.Message):
This field is a member of `oneof`_ ``source``.
id (str):
Id of the revision. Unique within the
context of the document.
Id of the revision, internally generated by
doc proto storage. Unique within the context of
the document.
parent (MutableSequence[int]):
The revisions that this revision is based on. This can
include one or more parent (when documents are merged.) This
Expand All @@ -1583,7 +1594,9 @@ class Revision(proto.Message):
eg. there are ``provenance.parent.revision`` fields that
index into this field.
create_time (google.protobuf.timestamp_pb2.Timestamp):
The time that the revision was created.
The time that the revision was created,
internally generated by doc proto storage at the
time of create.
human_review (google.cloud.documentai_v1beta3.types.Document.Revision.HumanReview):
Human Review information of this revision.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,50 @@
__protobuf__ = proto.module(
package="google.cloud.documentai.v1beta3",
manifest={
"EvaluationReference",
"Evaluation",
},
)


class EvaluationReference(proto.Message):
r"""Gives a short summary of an evaluation, and links to the
evaluation itself.
Attributes:
operation (str):
The resource name of the Long Running
Operation for the evaluation.
evaluation (str):
The resource name of the evaluation.
aggregate_metrics (google.cloud.documentai_v1beta3.types.Evaluation.Metrics):
An aggregate of the statistics for the
evaluation with fuzzy matching on.
aggregate_metrics_exact (google.cloud.documentai_v1beta3.types.Evaluation.Metrics):
An aggregate of the statistics for the
evaluation with fuzzy matching off.
"""

operation: str = proto.Field(
proto.STRING,
number=1,
)
evaluation: str = proto.Field(
proto.STRING,
number=2,
)
aggregate_metrics: "Evaluation.Metrics" = proto.Field(
proto.MESSAGE,
number=4,
message="Evaluation.Metrics",
)
aggregate_metrics_exact: "Evaluation.Metrics" = proto.Field(
proto.MESSAGE,
number=5,
message="Evaluation.Metrics",
)


class Evaluation(proto.Message):
r"""An evaluation of a ProcessorVersion's performance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import proto # type: ignore

from google.cloud.documentai_v1beta3.types import document_schema as gcd_document_schema
from google.cloud.documentai_v1beta3.types import evaluation

__protobuf__ = proto.module(
package="google.cloud.documentai.v1beta3",
Expand Down Expand Up @@ -50,6 +51,9 @@ class ProcessorVersion(proto.Message):
The state of the processor version.
create_time (google.protobuf.timestamp_pb2.Timestamp):
The time the processor version was created.
latest_evaluation (google.cloud.documentai_v1beta3.types.EvaluationReference):
The most recently invoked evaluation for the
processor version.
kms_key_name (str):
The KMS key name used for encryption.
kms_key_version_name (str):
Expand Down Expand Up @@ -143,6 +147,11 @@ class DeprecationInfo(proto.Message):
number=7,
message=timestamp_pb2.Timestamp,
)
latest_evaluation: evaluation.EvaluationReference = proto.Field(
proto.MESSAGE,
number=8,
message=evaluation.EvaluationReference,
)
kms_key_name: str = proto.Field(
proto.STRING,
number=9,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-documentai",
"version": "2.10.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-documentai",
"version": "2.10.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-documentai",
"version": "2.10.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down

0 comments on commit 0b5894e

Please sign in to comment.