Skip to content

Commit 624cc45

Browse files
Google APIscopybara-github
authored andcommitted
feat: add UpsertDatapoints and RemoveDatapoints rpcs to IndexService in aiplatform v1beta1 index_service.proto
PiperOrigin-RevId: 469481692
1 parent ebed4ae commit 624cc45

File tree

8 files changed

+159
-18
lines changed

8 files changed

+159
-18
lines changed

google/cloud/aiplatform/v1beta1/dataset_service.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,7 @@ message ListSavedQueriesRequest {
399399

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

406405
// The standard List next-page token.

google/cloud/aiplatform/v1beta1/explanation.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ message ExplanationSpec {
183183
// Required. Parameters that configure explaining of the Model's predictions.
184184
ExplanationParameters parameters = 1 [(google.api.field_behavior) = REQUIRED];
185185

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

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

google/cloud/aiplatform/v1beta1/index.proto

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ message Index {
3838
pattern: "projects/{project}/locations/{location}/indexes/{index}"
3939
};
4040

41+
// The update method of an Index.
42+
enum IndexUpdateMethod {
43+
// Should not be used.
44+
INDEX_UPDATE_METHOD_UNSPECIFIED = 0;
45+
46+
// BatchUpdate: user can call UpdateIndex with files on Cloud Storage of
47+
// datapoints to update.
48+
BATCH_UPDATE = 1;
49+
50+
// StreamUpdate: user can call UpsertDatapoints/DeleteDatapoints to update
51+
// the Index and the updates will be applied in corresponding
52+
// DeployedIndexes in nearly real-time.
53+
STREAM_UPDATE = 2;
54+
}
55+
4156
// Output only. The resource name of the Index.
4257
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
4358

@@ -93,4 +108,65 @@ message Index {
93108
// in the Index. Result of any successfully completed Operation on the Index
94109
// is reflected in it.
95110
google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
111+
112+
// Output only. Stats of the index resource.
113+
IndexStats index_stats = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
114+
115+
// Immutable. The update method to use with this Index. If not set, BATCH_UPDATE will be
116+
// used by default.
117+
IndexUpdateMethod index_update_method = 16 [(google.api.field_behavior) = IMMUTABLE];
118+
}
119+
120+
// A datapoint of Index.
121+
message IndexDatapoint {
122+
// Restriction of a datapoint which describe its attributes(tokens) from each
123+
// of several attribute categories(namespaces).
124+
message Restriction {
125+
// The namespace of this restriction. eg: color.
126+
string namespace = 1;
127+
128+
// The attributes to allow in this namespace. eg: 'red'
129+
repeated string allow_list = 2;
130+
131+
// The attributes to deny in this namespace. eg: 'blue'
132+
repeated string deny_list = 3;
133+
}
134+
135+
// Crowding tag is a constraint on a neighbor list produced by nearest
136+
// neighbor search requiring that no more than some value k' of the k
137+
// neighbors returned have the same value of crowding_attribute.
138+
message CrowdingTag {
139+
// The attribute value used for crowding. The maximum number of neighbors
140+
// to return per crowding attribute value
141+
// (per_crowding_attribute_num_neighbors) is configured per-query. This
142+
// field is ignored if per_crowding_attribute_num_neighbors is larger than
143+
// the total number of neighbors to return for a given query.
144+
string crowding_attribute = 1;
145+
}
146+
147+
// Required. Unique identifier of the datapoint.
148+
string datapoint_id = 1 [(google.api.field_behavior) = REQUIRED];
149+
150+
// Required. Feature embedding vector. An array of numbers with the length of
151+
// [NearestNeighborSearchConfig.dimensions].
152+
repeated float feature_vector = 2 [(google.api.field_behavior) = REQUIRED];
153+
154+
// Optional. List of Restrict of the datapoint, used to perform "restricted searches"
155+
// where boolean rule are used to filter the subset of the database eligible
156+
// for matching.
157+
// See: https://cloud.google.com/vertex-ai/docs/matching-engine/filtering
158+
repeated Restriction restricts = 4 [(google.api.field_behavior) = OPTIONAL];
159+
160+
// Optional. CrowdingTag of the datapoint, the number of neighbors to return in each
161+
// crowding can be configured during query.
162+
CrowdingTag crowding_tag = 5 [(google.api.field_behavior) = OPTIONAL];
163+
}
164+
165+
// Stats of the Index.
166+
message IndexStats {
167+
// Output only. The number of vectors in the Index.
168+
int64 vectors_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
169+
170+
// Output only. The number of shards in the Index.
171+
int32 shards_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
96172
}

google/cloud/aiplatform/v1beta1/index_service.proto

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,22 @@ service IndexService {
9393
metadata_type: "DeleteOperationMetadata"
9494
};
9595
}
96+
97+
// Add/update Datapoints into an Index.
98+
rpc UpsertDatapoints(UpsertDatapointsRequest) returns (UpsertDatapointsResponse) {
99+
option (google.api.http) = {
100+
post: "/v1beta1/{index=projects/*/locations/*/indexes/*}:upsertDatapoints"
101+
body: "*"
102+
};
103+
}
104+
105+
// Remove Datapoints from an Index.
106+
rpc RemoveDatapoints(RemoveDatapointsRequest) returns (RemoveDatapointsResponse) {
107+
option (google.api.http) = {
108+
post: "/v1beta1/{index=projects/*/locations/*/indexes/*}:removeDatapoints"
109+
body: "*"
110+
};
111+
}
96112
}
97113

98114
// Request message for [IndexService.CreateIndex][google.cloud.aiplatform.v1beta1.IndexService.CreateIndex].
@@ -201,6 +217,48 @@ message DeleteIndexRequest {
201217
];
202218
}
203219

220+
// Request message for [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints]
221+
message UpsertDatapointsRequest {
222+
// Required. The name of the Index resource to be updated.
223+
// Format:
224+
// `projects/{project}/locations/{location}/indexes/{index}`
225+
string index = 1 [
226+
(google.api.field_behavior) = REQUIRED,
227+
(google.api.resource_reference) = {
228+
type: "aiplatform.googleapis.com/Index"
229+
}
230+
];
231+
232+
// A list of datapoints to be created/updated.
233+
repeated IndexDatapoint datapoints = 2;
234+
}
235+
236+
// Response message for [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints]
237+
message UpsertDatapointsResponse {
238+
239+
}
240+
241+
// Request message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints]
242+
message RemoveDatapointsRequest {
243+
// Required. The name of the Index resource to be updated.
244+
// Format:
245+
// `projects/{project}/locations/{location}/indexes/{index}`
246+
string index = 1 [
247+
(google.api.field_behavior) = REQUIRED,
248+
(google.api.resource_reference) = {
249+
type: "aiplatform.googleapis.com/Index"
250+
}
251+
];
252+
253+
// A list of datapoint ids to be deleted.
254+
repeated string datapoint_ids = 2;
255+
}
256+
257+
// Response message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints]
258+
message RemoveDatapointsResponse {
259+
260+
}
261+
204262
// Runtime operation metadata with regard to Matching Engine Index.
205263
message NearestNeighborSearchOperationMetadata {
206264
message RecordError {

google/cloud/aiplatform/v1beta1/model_monitoring.proto

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ option java_package = "com.google.cloud.aiplatform.v1beta1";
2727
option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
2828
option ruby_package = "Google::Cloud::AIPlatform::V1beta1";
2929

30-
// Next ID: 5
30+
// The model monitoring configuration used for Batch Prediction Job.
3131
message ModelMonitoringConfig {
3232
// Model monitoring objective config.
3333
repeated ModelMonitoringObjectiveConfig objective_configs = 3;
@@ -43,17 +43,24 @@ message ModelMonitoringConfig {
4343
// For models trained with Vertex AI, this field must be set as all the
4444
// fields in predict instance formatted as string.
4545
string analysis_instance_schema_uri = 4;
46+
47+
// A Google Cloud Storage location for batch prediction model monitoring to
48+
// dump statistics and anomalies.
49+
// If not provided, a folder will be created in customer project to hold
50+
// statistics and anomalies.
51+
GcsDestination stats_anomalies_base_directory = 5;
4652
}
4753

48-
// Next ID: 8
54+
// The objective configuration for model monitoring, including the information
55+
// needed to detect anomalies for one particular model.
4956
message ModelMonitoringObjectiveConfig {
5057
// Training Dataset information.
5158
message TrainingDataset {
5259
oneof data_source {
5360
// The resource name of the Dataset used to train this Model.
5461
string dataset = 3 [(google.api.resource_reference) = {
55-
type: "aiplatform.googleapis.com/Dataset"
56-
}];
62+
type: "aiplatform.googleapis.com/Dataset"
63+
}];
5764

5865
// The Google Cloud Storage uri of the unmanaged Dataset used to train
5966
// this Model.
@@ -128,8 +135,10 @@ message ModelMonitoringObjectiveConfig {
128135
// The config for integrating with Vertex Explainable AI. Only applicable if
129136
// the Model has explanation_spec populated.
130137
message ExplanationConfig {
131-
// Output from [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob] for Model Monitoring baseline dataset,
132-
// which can be used to generate baseline attribution scores.
138+
// Output from
139+
// [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]
140+
// for Model Monitoring baseline dataset, which can be used to generate
141+
// baseline attribution scores.
133142
message ExplanationBaseline {
134143
// The storage format of the predictions generated BatchPrediction job.
135144
enum PredictionFormat {
@@ -171,7 +180,8 @@ message ModelMonitoringObjectiveConfig {
171180
TrainingDataset training_dataset = 1;
172181

173182
// The config for skew between training data and prediction data.
174-
TrainingPredictionSkewDetectionConfig training_prediction_skew_detection_config = 2;
183+
TrainingPredictionSkewDetectionConfig
184+
training_prediction_skew_detection_config = 2;
175185

176186
// The config for drift of prediction data.
177187
PredictionDriftDetectionConfig prediction_drift_detection_config = 3;
@@ -180,7 +190,6 @@ message ModelMonitoringObjectiveConfig {
180190
ExplanationConfig explanation_config = 5;
181191
}
182192

183-
// Next ID: 3
184193
message ModelMonitoringAlertConfig {
185194
// The config for email alert.
186195
message EmailAlertConfig {
@@ -202,7 +211,6 @@ message ModelMonitoringAlertConfig {
202211
}
203212

204213
// The config for feature monitoring threshold.
205-
// Next ID: 3
206214
message ThresholdConfig {
207215
oneof threshold {
208216
// Specify a threshold value that can trigger the alert.
@@ -219,7 +227,6 @@ message ThresholdConfig {
219227

220228
// Sampling Strategy for logging, can be for both training and prediction
221229
// dataset.
222-
// Next ID: 2
223230
message SamplingStrategy {
224231
// Requests are randomly selected.
225232
message RandomSampleConfig {

google/cloud/aiplatform/v1beta1/model_service.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ message MergeVersionAliasesRequest {
465465

466466
// Required. The set of version aliases to merge.
467467
// The alias should be at most 128 characters, and match
468-
// `[a-z][a-z0-9-]{0,126}[a-z-0-9]`.
468+
// `[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]`.
469469
// Add the `-` prefix to an alias means removing that alias from the version.
470470
// `-` is NOT counted in the 128 characters. Example: `-golden` means removing
471471
// the `golden` alias from the version.

google/cloud/aiplatform/v1beta1/saved_query.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ message SavedQuery {
5959

6060
// Required. Problem type of the SavedQuery.
6161
// Allowed values:
62+
//
6263
// * IMAGE_CLASSIFICATION_SINGLE_LABEL
6364
// * IMAGE_CLASSIFICATION_MULTI_LABEL
6465
// * IMAGE_BOUNDING_POLY
@@ -74,7 +75,7 @@ message SavedQuery {
7475
// Output only. Number of AnnotationSpecs in the context of the SavedQuery.
7576
int32 annotation_spec_count = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
7677

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

google/cloud/aiplatform/v1beta1/vizier_service.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ message SuggestTrialsRequest {
285285
}
286286
];
287287

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

291291
// Required. The identifier of the client that is requesting the suggestion.

0 commit comments

Comments
 (0)