@@ -22,6 +22,8 @@ import "google/api/field_behavior.proto";
2222import "google/api/resource.proto" ;
2323import "google/cloud/aiplatform/v1/featurestore_online_service.proto" ;
2424import "google/protobuf/struct.proto" ;
25+ import "google/protobuf/timestamp.proto" ;
26+ import "google/rpc/status.proto" ;
2527
2628option csharp_namespace = "Google.Cloud.AIPlatform.V1" ;
2729option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb" ;
@@ -57,6 +59,17 @@ service FeatureOnlineStoreService {
5759 body : "*"
5860 };
5961 }
62+
63+ // Bidirectional streaming RPC to directly write to feature values in a
64+ // feature view. Requests may not have a one-to-one mapping to responses and
65+ // responses may be returned out-of-order to reduce latency.
66+ rpc FeatureViewDirectWrite (stream FeatureViewDirectWriteRequest )
67+ returns (stream FeatureViewDirectWriteResponse ) {
68+ option (google.api.http ) = {
69+ post : "/v1/{feature_view=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:directWrite"
70+ body : "*"
71+ };
72+ }
6073}
6174
6275// Format of the data in the Feature View.
@@ -329,3 +342,75 @@ message SearchNearestEntitiesResponse {
329342 // The nearest neighbors of the query entity.
330343 NearestNeighbors nearest_neighbors = 1 ;
331344}
345+
346+ // Request message for
347+ // [FeatureOnlineStoreService.FeatureViewDirectWrite][google.cloud.aiplatform.v1.FeatureOnlineStoreService.FeatureViewDirectWrite].
348+ message FeatureViewDirectWriteRequest {
349+ // A data key and associated feature values to write to the feature view.
350+ message DataKeyAndFeatureValues {
351+ // Feature name & value pair.
352+ message Feature {
353+ // Feature value data to write.
354+ oneof data_oneof {
355+ // Feature value. A user provided timestamp may be set in the
356+ // `FeatureValue.metadata.generate_time` field.
357+ FeatureValue value = 3 ;
358+ }
359+
360+ // Feature short name.
361+ string name = 1 ;
362+ }
363+
364+ // The data key.
365+ FeatureViewDataKey data_key = 1 ;
366+
367+ // List of features to write.
368+ repeated Feature features = 2 ;
369+ }
370+
371+ // FeatureView resource format
372+ // `projects/{project}/locations/{location}/featureOnlineStores/{featureOnlineStore}/featureViews/{featureView}`
373+ string feature_view = 1 [(google.api.resource_reference ) = {
374+ type : "aiplatform.googleapis.com/FeatureView"
375+ }];
376+
377+ // Required. The data keys and associated feature values.
378+ repeated DataKeyAndFeatureValues data_key_and_feature_values = 2
379+ [(google.api.field_behavior ) = REQUIRED ];
380+ }
381+
382+ // Response message for
383+ // [FeatureOnlineStoreService.FeatureViewDirectWrite][google.cloud.aiplatform.v1.FeatureOnlineStoreService.FeatureViewDirectWrite].
384+ message FeatureViewDirectWriteResponse {
385+ // Details about the write for each key.
386+ message WriteResponse {
387+ // What key is this write response associated with.
388+ FeatureViewDataKey data_key = 1 ;
389+
390+ // When the feature values were written to the online store.
391+ // If
392+ // [FeatureViewDirectWriteResponse.status][google.cloud.aiplatform.v1.FeatureViewDirectWriteResponse.status]
393+ // is not OK, this field is not populated.
394+ google.protobuf.Timestamp online_store_write_time = 2 ;
395+ }
396+
397+ // Response status for the keys listed in
398+ // [FeatureViewDirectWriteResponse.write_responses][google.cloud.aiplatform.v1.FeatureViewDirectWriteResponse.write_responses].
399+ //
400+ // The error only applies to the
401+ // listed data keys - the stream will remain open for further
402+ // [FeatureOnlineStoreService.FeatureViewDirectWriteRequest][] requests.
403+ //
404+ // Partial failures (e.g. if the first 10 keys of a request fail, but the
405+ // rest succeed) from a single request may result in multiple responses -
406+ // there will be one response for the successful request keys and one response
407+ // for the failing request keys.
408+ google.rpc.Status status = 1 ;
409+
410+ // Details about write for each key. If status is not OK,
411+ // [WriteResponse.data_key][google.cloud.aiplatform.v1.FeatureViewDirectWriteResponse.WriteResponse.data_key]
412+ // will have the key with error, but
413+ // [WriteResponse.online_store_write_time][google.cloud.aiplatform.v1.FeatureViewDirectWriteResponse.WriteResponse.online_store_write_time]
414+ // will not be present.
415+ repeated WriteResponse write_responses = 2 ;
416+ }
0 commit comments