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

fix: allow passing gax instance to client constructor #365

Merged
merged 14 commits into from
Sep 8, 2022
Merged
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
3 changes: 1 addition & 2 deletions protos/google/cloud/aiplatform/v1/dataset_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,7 @@ message ListSavedQueriesRequest {

// Response message for [DatasetService.ListSavedQueries][google.cloud.aiplatform.v1.DatasetService.ListSavedQueries].
message ListSavedQueriesResponse {
// A list of SavedQueries that matches the specified filter in the
// request.
// A list of SavedQueries that match the specified filter in the request.
repeated SavedQuery saved_queries = 1;

// The standard List next-page token.
Expand Down
6 changes: 3 additions & 3 deletions protos/google/cloud/aiplatform/v1/explanation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ message ExplanationSpec {
// Required. Parameters that configure explaining of the Model's predictions.
ExplanationParameters parameters = 1 [(google.api.field_behavior) = REQUIRED];

// Required. Metadata describing the Model's input and output for explanation.
ExplanationMetadata metadata = 2 [(google.api.field_behavior) = REQUIRED];
// Optional. Metadata describing the Model's input and output for explanation.
ExplanationMetadata metadata = 2 [(google.api.field_behavior) = OPTIONAL];
}

// Parameters to configure explaining for Model's predictions.
Expand Down Expand Up @@ -224,7 +224,7 @@ message ExplanationParameters {
// explaining.
//
// If not populated, returns attributions for [top_k][google.cloud.aiplatform.v1.ExplanationParameters.top_k] indices of outputs.
// If neither top_k nor output_indeices is populated, returns the argmax
// If neither top_k nor output_indices is populated, returns the argmax
// index of the outputs.
//
// Only applicable to Models that predict multiple outputs (e,g, multi-class
Expand Down
76 changes: 76 additions & 0 deletions protos/google/cloud/aiplatform/v1/index.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ message Index {
pattern: "projects/{project}/locations/{location}/indexes/{index}"
};

// The update method of an Index.
enum IndexUpdateMethod {
// Should not be used.
INDEX_UPDATE_METHOD_UNSPECIFIED = 0;

// BatchUpdate: user can call UpdateIndex with files on Cloud Storage of
// datapoints to update.
BATCH_UPDATE = 1;

// StreamUpdate: user can call UpsertDatapoints/DeleteDatapoints to update
// the Index and the updates will be applied in corresponding
// DeployedIndexes in nearly real-time.
STREAM_UPDATE = 2;
}

// Output only. The resource name of the Index.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

Expand Down Expand Up @@ -93,4 +108,65 @@ message Index {
// in the Index. Result of any successfully completed Operation on the Index
// is reflected in it.
google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Stats of the index resource.
IndexStats index_stats = 14 [(google.api.field_behavior) = OUTPUT_ONLY];

// Immutable. The update method to use with this Index. If not set, BATCH_UPDATE will be
// used by default.
IndexUpdateMethod index_update_method = 16 [(google.api.field_behavior) = IMMUTABLE];
}

// A datapoint of Index.
message IndexDatapoint {
// Restriction of a datapoint which describe its attributes(tokens) from each
// of several attribute categories(namespaces).
message Restriction {
// The namespace of this restriction. eg: color.
string namespace = 1;

// The attributes to allow in this namespace. eg: 'red'
repeated string allow_list = 2;

// The attributes to deny in this namespace. eg: 'blue'
repeated string deny_list = 3;
}

// Crowding tag is a constraint on a neighbor list produced by nearest
// neighbor search requiring that no more than some value k' of the k
// neighbors returned have the same value of crowding_attribute.
message CrowdingTag {
// The attribute value used for crowding. The maximum number of neighbors
// to return per crowding attribute value
// (per_crowding_attribute_num_neighbors) is configured per-query. This
// field is ignored if per_crowding_attribute_num_neighbors is larger than
// the total number of neighbors to return for a given query.
string crowding_attribute = 1;
}

// Required. Unique identifier of the datapoint.
string datapoint_id = 1 [(google.api.field_behavior) = REQUIRED];

// Required. Feature embedding vector. An array of numbers with the length of
// [NearestNeighborSearchConfig.dimensions].
repeated float feature_vector = 2 [(google.api.field_behavior) = REQUIRED];

// Optional. List of Restrict of the datapoint, used to perform "restricted searches"
// where boolean rule are used to filter the subset of the database eligible
// for matching.
// See: https://cloud.google.com/vertex-ai/docs/matching-engine/filtering
repeated Restriction restricts = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. CrowdingTag of the datapoint, the number of neighbors to return in each
// crowding can be configured during query.
CrowdingTag crowding_tag = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Stats of the Index.
message IndexStats {
// Output only. The number of vectors in the Index.
int64 vectors_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The number of shards in the Index.
int32 shards_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}
58 changes: 58 additions & 0 deletions protos/google/cloud/aiplatform/v1/index_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ service IndexService {
metadata_type: "DeleteOperationMetadata"
};
}

// Add/update Datapoints into an Index.
rpc UpsertDatapoints(UpsertDatapointsRequest) returns (UpsertDatapointsResponse) {
option (google.api.http) = {
post: "/v1/{index=projects/*/locations/*/indexes/*}:upsertDatapoints"
body: "*"
};
}

// Remove Datapoints from an Index.
rpc RemoveDatapoints(RemoveDatapointsRequest) returns (RemoveDatapointsResponse) {
option (google.api.http) = {
post: "/v1/{index=projects/*/locations/*/indexes/*}:removeDatapoints"
body: "*"
};
}
}

// Request message for [IndexService.CreateIndex][google.cloud.aiplatform.v1.IndexService.CreateIndex].
Expand Down Expand Up @@ -201,6 +217,48 @@ message DeleteIndexRequest {
];
}

// Request message for [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1.IndexService.UpsertDatapoints]
message UpsertDatapointsRequest {
// Required. The name of the Index resource to be updated.
// Format:
// `projects/{project}/locations/{location}/indexes/{index}`
string index = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/Index"
}
];

// A list of datapoints to be created/updated.
repeated IndexDatapoint datapoints = 2;
}

// Response message for [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1.IndexService.UpsertDatapoints]
message UpsertDatapointsResponse {

}

// Request message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1.IndexService.RemoveDatapoints]
message RemoveDatapointsRequest {
// Required. The name of the Index resource to be updated.
// Format:
// `projects/{project}/locations/{location}/indexes/{index}`
string index = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/Index"
}
];

// A list of datapoint ids to be deleted.
repeated string datapoint_ids = 2;
}

// Response message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1.IndexService.RemoveDatapoints]
message RemoveDatapointsResponse {

}

// Runtime operation metadata with regard to Matching Engine Index.
message NearestNeighborSearchOperationMetadata {
message RecordError {
Expand Down
6 changes: 2 additions & 4 deletions protos/google/cloud/aiplatform/v1/model_monitoring.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ option java_package = "com.google.cloud.aiplatform.v1";
option php_namespace = "Google\\Cloud\\AIPlatform\\V1";
option ruby_package = "Google::Cloud::AIPlatform::V1";

// Next ID: 8
// The objective configuration for model monitoring, including the information
// needed to detect anomalies for one particular model.
message ModelMonitoringObjectiveConfig {
// Training Dataset information.
message TrainingDataset {
Expand Down Expand Up @@ -162,7 +163,6 @@ message ModelMonitoringObjectiveConfig {
ExplanationConfig explanation_config = 5;
}

// Next ID: 3
message ModelMonitoringAlertConfig {
// The config for email alert.
message EmailAlertConfig {
Expand All @@ -184,7 +184,6 @@ message ModelMonitoringAlertConfig {
}

// The config for feature monitoring threshold.
// Next ID: 3
message ThresholdConfig {
oneof threshold {
// Specify a threshold value that can trigger the alert.
Expand All @@ -201,7 +200,6 @@ message ThresholdConfig {

// Sampling Strategy for logging, can be for both training and prediction
// dataset.
// Next ID: 2
message SamplingStrategy {
// Requests are randomly selected.
message RandomSampleConfig {
Expand Down
2 changes: 1 addition & 1 deletion protos/google/cloud/aiplatform/v1/model_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ message MergeVersionAliasesRequest {

// Required. The set of version aliases to merge.
// The alias should be at most 128 characters, and match
// `[a-z][a-z0-9-]{0,126}[a-z-0-9]`.
// `[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]`.
// Add the `-` prefix to an alias means removing that alias from the version.
// `-` is NOT counted in the 128 characters. Example: `-golden` means removing
// the `golden` alias from the version.
Expand Down
16 changes: 16 additions & 0 deletions protos/google/cloud/aiplatform/v1/pipeline_job.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ message PipelineJob {

// The runtime config of a PipelineJob.
message RuntimeConfig {
// The type of an input artifact.
message InputArtifact {
oneof kind {
// Artifact resource id from MLMD. Which is the last portion of an
// artifact resource
// name(projects/{project}/locations/{location}/metadataStores/default/artifacts/{artifact_id}).
// The artifact must stay within the same project, location and default
// metadatastore as the pipeline.
string artifact_id = 1;
}
}

// Deprecated. Use [RuntimeConfig.parameter_values][google.cloud.aiplatform.v1.PipelineJob.RuntimeConfig.parameter_values] instead. The runtime
// parameters of the PipelineJob. The parameters will be passed into
// [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec] to replace the placeholders at runtime.
Expand Down Expand Up @@ -81,6 +93,10 @@ message PipelineJob {
// will stop scheduling any new tasks when a task has failed. Any scheduled
// tasks will continue to completion.
PipelineFailurePolicy failure_policy = 4;

// The runtime artifacts of the PipelineJob. The key will be the input
// artifact name and the value would be one of the InputArtifact.
map<string, InputArtifact> input_artifacts = 5;
}

// Output only. The resource name of the PipelineJob.
Expand Down
3 changes: 3 additions & 0 deletions protos/google/cloud/aiplatform/v1/pipeline_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ message ListPipelineJobsRequest {
// * `end_time`
// * `start_time`
string order_by = 6;

// Mask specifying which fields to read.
google.protobuf.FieldMask read_mask = 7;
}

// Response message for [PipelineService.ListPipelineJobs][google.cloud.aiplatform.v1.PipelineService.ListPipelineJobs]
Expand Down
3 changes: 2 additions & 1 deletion protos/google/cloud/aiplatform/v1/saved_query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ message SavedQuery {

// Required. Problem type of the SavedQuery.
// Allowed values:
//
// * IMAGE_CLASSIFICATION_SINGLE_LABEL
// * IMAGE_CLASSIFICATION_MULTI_LABEL
// * IMAGE_BOUNDING_POLY
Expand All @@ -74,7 +75,7 @@ message SavedQuery {
// Output only. Number of AnnotationSpecs in the context of the SavedQuery.
int32 annotation_spec_count = 10 [(google.api.field_behavior) = OUTPUT_ONLY];

// Used to perform consistent read-modify-write updates. If not set, a blind
// Used to perform a consistent read-modify-write update. If not set, a blind
// "overwrite" update happens.
string etag = 8;

Expand Down
2 changes: 1 addition & 1 deletion protos/google/cloud/aiplatform/v1/vizier_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ message SuggestTrialsRequest {
}
];

// Required. The number of suggestions requested.
// Required. The number of suggestions requested. It must be positive.
int32 suggestion_count = 2 [(google.api.field_behavior) = REQUIRED];

// Required. The identifier of the client that is requesting the suggestion.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import "google/cloud/aiplatform/v1beta1/io.proto";
import "google/cloud/aiplatform/v1beta1/job_state.proto";
import "google/cloud/aiplatform/v1beta1/machine_resources.proto";
import "google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto";
import "google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto";
import "google/cloud/aiplatform/v1beta1/model_monitoring.proto";
import "google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto";
import "google/protobuf/struct.proto";
Expand Down Expand Up @@ -304,4 +305,10 @@ message BatchPredictionJob {
// the input and output to the batch prediction job, as well as the provided
// training dataset.
ModelMonitoringConfig model_monitoring_config = 26;

// Get batch prediction job monitoring statistics.
repeated ModelMonitoringStatsAnomalies model_monitoring_stats_anomalies = 31;

// Output only. The running status of the model monitoring pipeline.
google.rpc.Status model_monitoring_status = 32 [(google.api.field_behavior) = OUTPUT_ONLY];
}
3 changes: 1 addition & 2 deletions protos/google/cloud/aiplatform/v1beta1/dataset_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,7 @@ message ListSavedQueriesRequest {

// Response message for [DatasetService.ListSavedQueries][google.cloud.aiplatform.v1beta1.DatasetService.ListSavedQueries].
message ListSavedQueriesResponse {
// A list of SavedQueries that matches the specified filter in the
// request.
// A list of SavedQueries that match the specified filter in the request.
repeated SavedQuery saved_queries = 1;

// The standard List next-page token.
Expand Down
6 changes: 3 additions & 3 deletions protos/google/cloud/aiplatform/v1beta1/explanation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ message ExplanationSpec {
// Required. Parameters that configure explaining of the Model's predictions.
ExplanationParameters parameters = 1 [(google.api.field_behavior) = REQUIRED];

// Required. Metadata describing the Model's input and output for explanation.
ExplanationMetadata metadata = 2 [(google.api.field_behavior) = REQUIRED];
// Optional. Metadata describing the Model's input and output for explanation.
ExplanationMetadata metadata = 2 [(google.api.field_behavior) = OPTIONAL];
}

// Parameters to configure explaining for Model's predictions.
Expand Down Expand Up @@ -229,7 +229,7 @@ message ExplanationParameters {
// explaining.
//
// If not populated, returns attributions for [top_k][google.cloud.aiplatform.v1beta1.ExplanationParameters.top_k] indices of outputs.
// If neither top_k nor output_indeices is populated, returns the argmax
// If neither top_k nor output_indices is populated, returns the argmax
// index of the outputs.
//
// Only applicable to Models that predict multiple outputs (e,g, multi-class
Expand Down
Loading