Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions google/cloud/aiplatform_v1/types/pipeline_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,15 @@ class PipelineTaskDetail(proto.Message):
outputs (MutableMapping[str, google.cloud.aiplatform_v1.types.PipelineTaskDetail.ArtifactList]):
Output only. The runtime output artifacts of
the task.
task_unique_name (str):
Output only. The unique name of a task. This field is used
by rerun pipeline job. Console UI and Vertex AI SDK will
support triggering pipeline job reruns. The name is
constructed by concatenating all the parent tasks name with
the task name. For example, if a task named "child_task" has
a parent task named "parent_task_1" and parent task 1 has a
parent task named "parent_task_2", the task unique name will
be "parent_task_2.parent_task_1.child_task".
"""

class State(proto.Enum):
Expand Down Expand Up @@ -603,6 +612,10 @@ class ArtifactList(proto.Message):
number=11,
message=ArtifactList,
)
task_unique_name: str = proto.Field(
proto.STRING,
number=14,
)


class PipelineTaskExecutorDetail(proto.Message):
Expand Down
6 changes: 6 additions & 0 deletions google/cloud/aiplatform_v1beta1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@
from .types.evaluated_annotation import ErrorAnalysisAnnotation
from .types.evaluated_annotation import EvaluatedAnnotation
from .types.evaluated_annotation import EvaluatedAnnotationExplanation
from .types.evaluation_service import AggregationOutput
from .types.evaluation_service import AggregationResult
from .types.evaluation_service import AutoraterConfig
from .types.evaluation_service import BleuInput
from .types.evaluation_service import BleuInstance
Expand Down Expand Up @@ -731,6 +733,7 @@
from .types.machine_resources import BatchDedicatedResources
from .types.machine_resources import DedicatedResources
from .types.machine_resources import DiskSpec
from .types.machine_resources import FlexStart
from .types.machine_resources import MachineSpec
from .types.machine_resources import NfsMount
from .types.machine_resources import PersistentDiskSpec
Expand Down Expand Up @@ -1334,6 +1337,8 @@
"AddExecutionEventsRequest",
"AddExecutionEventsResponse",
"AddTrialMeasurementRequest",
"AggregationOutput",
"AggregationResult",
"Annotation",
"AnnotationSpec",
"ApiAuth",
Expand Down Expand Up @@ -1725,6 +1730,7 @@
"FilterSplit",
"FindNeighborsRequest",
"FindNeighborsResponse",
"FlexStart",
"FluencyInput",
"FluencyInstance",
"FluencyResult",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,40 +265,40 @@ def parse_dataset_path(path: str) -> Dict[str, str]:
@staticmethod
def dataset_path(
project: str,
location: str,
dataset: str,
) -> str:
"""Returns a fully-qualified dataset string."""
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
return "projects/{project}/datasets/{dataset}".format(
project=project,
location=location,
dataset=dataset,
)

@staticmethod
def parse_dataset_path(path: str) -> Dict[str, str]:
"""Parses a dataset path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
path,
)
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
return m.groupdict() if m else {}

@staticmethod
def dataset_path(
project: str,
location: str,
dataset: str,
) -> str:
"""Returns a fully-qualified dataset string."""
return "projects/{project}/datasets/{dataset}".format(
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
project=project,
location=location,
dataset=dataset,
)

@staticmethod
def parse_dataset_path(path: str) -> Dict[str, str]:
"""Parses a dataset path into its component segments."""
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
m = re.match(
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
path,
)
return m.groupdict() if m else {}

@staticmethod
Expand Down
6 changes: 6 additions & 0 deletions google/cloud/aiplatform_v1beta1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@
EvaluatedAnnotationExplanation,
)
from .evaluation_service import (
AggregationOutput,
AggregationResult,
AutoraterConfig,
BleuInput,
BleuInstance,
Expand Down Expand Up @@ -756,6 +758,7 @@
BatchDedicatedResources,
DedicatedResources,
DiskSpec,
FlexStart,
MachineSpec,
NfsMount,
PersistentDiskSpec,
Expand Down Expand Up @@ -1593,6 +1596,8 @@
"ErrorAnalysisAnnotation",
"EvaluatedAnnotation",
"EvaluatedAnnotationExplanation",
"AggregationOutput",
"AggregationResult",
"AutoraterConfig",
"BleuInput",
"BleuInstance",
Expand Down Expand Up @@ -2060,6 +2065,7 @@
"BatchDedicatedResources",
"DedicatedResources",
"DiskSpec",
"FlexStart",
"MachineSpec",
"NfsMount",
"PersistentDiskSpec",
Expand Down
140 changes: 128 additions & 12 deletions google/cloud/aiplatform_v1beta1/types/evaluation_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"EvaluateDatasetOperationMetadata",
"EvaluateDatasetResponse",
"OutputInfo",
"AggregationOutput",
"AggregationResult",
"EvaluateDatasetRequest",
"OutputConfig",
"Metric",
Expand Down Expand Up @@ -228,11 +230,20 @@ class EvaluateDatasetResponse(proto.Message):
r"""Response in LRO for EvaluationService.EvaluateDataset.

Attributes:
aggregation_output (google.cloud.aiplatform_v1beta1.types.AggregationOutput):
Output only. Aggregation statistics derived
from results of
EvaluationService.EvaluateDataset.
output_info (google.cloud.aiplatform_v1beta1.types.OutputInfo):
Output only. Output info for
EvaluationService.EvaluateDataset.
"""

aggregation_output: "AggregationOutput" = proto.Field(
proto.MESSAGE,
number=1,
message="AggregationOutput",
)
output_info: "OutputInfo" = proto.Field(
proto.MESSAGE,
number=3,
Expand Down Expand Up @@ -264,6 +275,102 @@ class OutputInfo(proto.Message):
)


class AggregationOutput(proto.Message):
r"""The aggregation result for the entire dataset and all
metrics.

Attributes:
dataset (google.cloud.aiplatform_v1beta1.types.EvaluationDataset):
The dataset used for evaluation &
aggregation.
aggregation_results (MutableSequence[google.cloud.aiplatform_v1beta1.types.AggregationResult]):
One AggregationResult per metric.
"""

dataset: "EvaluationDataset" = proto.Field(
proto.MESSAGE,
number=1,
message="EvaluationDataset",
)
aggregation_results: MutableSequence["AggregationResult"] = proto.RepeatedField(
proto.MESSAGE,
number=2,
message="AggregationResult",
)


class AggregationResult(proto.Message):
r"""The aggregation result for a single metric.

This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.

.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Attributes:
pointwise_metric_result (google.cloud.aiplatform_v1beta1.types.PointwiseMetricResult):
Result for pointwise metric.

This field is a member of `oneof`_ ``aggregation_result``.
pairwise_metric_result (google.cloud.aiplatform_v1beta1.types.PairwiseMetricResult):
Result for pairwise metric.

This field is a member of `oneof`_ ``aggregation_result``.
exact_match_metric_value (google.cloud.aiplatform_v1beta1.types.ExactMatchMetricValue):
Results for exact match metric.

This field is a member of `oneof`_ ``aggregation_result``.
bleu_metric_value (google.cloud.aiplatform_v1beta1.types.BleuMetricValue):
Results for bleu metric.

This field is a member of `oneof`_ ``aggregation_result``.
rouge_metric_value (google.cloud.aiplatform_v1beta1.types.RougeMetricValue):
Results for rouge metric.

This field is a member of `oneof`_ ``aggregation_result``.
aggregation_metric (google.cloud.aiplatform_v1beta1.types.Metric.AggregationMetric):
Aggregation metric.
"""

pointwise_metric_result: "PointwiseMetricResult" = proto.Field(
proto.MESSAGE,
number=5,
oneof="aggregation_result",
message="PointwiseMetricResult",
)
pairwise_metric_result: "PairwiseMetricResult" = proto.Field(
proto.MESSAGE,
number=6,
oneof="aggregation_result",
message="PairwiseMetricResult",
)
exact_match_metric_value: "ExactMatchMetricValue" = proto.Field(
proto.MESSAGE,
number=7,
oneof="aggregation_result",
message="ExactMatchMetricValue",
)
bleu_metric_value: "BleuMetricValue" = proto.Field(
proto.MESSAGE,
number=8,
oneof="aggregation_result",
message="BleuMetricValue",
)
rouge_metric_value: "RougeMetricValue" = proto.Field(
proto.MESSAGE,
number=9,
oneof="aggregation_result",
message="RougeMetricValue",
)
aggregation_metric: "Metric.AggregationMetric" = proto.Field(
proto.ENUM,
number=4,
enum="Metric.AggregationMetric",
)


class EvaluateDatasetRequest(proto.Message):
r"""Request message for EvaluationService.EvaluateDataset.

Expand Down Expand Up @@ -373,25 +480,34 @@ class AggregationMetric(proto.Enum):
AGGREGATION_METRIC_UNSPECIFIED (0):
Unspecified aggregation metric.
AVERAGE (1):
Average aggregation metric.
Average aggregation metric. Not supported for
Pairwise metric.
MODE (2):
Mode aggregation metric.
STANDARD_DEVIATION (3):
Standard deviation aggregation metric.
Standard deviation aggregation metric. Not
supported for pairwise metric.
VARIANCE (4):
Variance aggregation metric.
Variance aggregation metric. Not supported
for pairwise metric.
MINIMUM (5):
Minimum aggregation metric.
Minimum aggregation metric. Not supported for
pairwise metric.
MAXIMUM (6):
Maximum aggregation metric.
Maximum aggregation metric. Not supported for
pairwise metric.
MEDIAN (7):
Median aggregation metric.
Median aggregation metric. Not supported for
pairwise metric.
PERCENTILE_P90 (8):
90th percentile aggregation metric.
90th percentile aggregation metric. Not
supported for pairwise metric.
PERCENTILE_P95 (9):
95th percentile aggregation metric.
95th percentile aggregation metric. Not
supported for pairwise metric.
PERCENTILE_P99 (10):
99th percentile aggregation metric.
99th percentile aggregation metric. Not
supported for pairwise metric.
"""
AGGREGATION_METRIC_UNSPECIFIED = 0
AVERAGE = 1
Expand Down Expand Up @@ -494,9 +610,9 @@ class AutoraterConfig(proto.Message):

This field is a member of `oneof`_ ``_sampling_count``.
flip_enabled (bool):
Optional. Whether to flip the candidate and baseline
responses. This is only applicable to the pairwise metric.
If enabled, also provide
Optional. Default is true. Whether to flip the candidate and
baseline responses. This is only applicable to the pairwise
metric. If enabled, also provide
PairwiseMetricSpec.candidate_response_field_name and
PairwiseMetricSpec.baseline_response_field_name. When
rendering PairwiseMetricSpec.metric_prompt_template, the
Expand Down
Loading