@@ -26,73 +26,37 @@ option java_outer_classname = "ServingAPIProto";
2626option go_package = "github.com/gojek/feast/protos/generated/go/feast/serving" ;
2727
2828service ServingAPI {
29- // Query features from Feast
30- rpc QueryFeatures (QueryFeatures.Request ) returns (QueryFeatures.Response ) {};
29+ // Query features from Feast serving storage
30+ rpc QueryFeatures (QueryFeaturesRequest ) returns (QueryFeaturesResponse ) {};
3131}
3232
33- message QueryFeatures {
34- message Request {
35- // e.g. "driver", "customer", "city".
36- string entityName = 1 ;
37- // List of entity ID.
38- repeated string entityId = 2 ;
39- // List of request details, contains: featureId, type of query, and limit.
40- repeated RequestDetail requestDetails = 3 ;
41- // Filter specifying only to retrieve features having timestamp within this range.
42- TimestampRange timestampRange = 4 ;
43- }
44-
45- message Response {
46- // e.g. "driver", "customer", "city".
47- string entityName = 1 ;
48- // map of entity ID and its entity's properties.
49- map <string , Entity > entities = 2 ;
50- }
51- }
52-
53- message RequestDetail {
54- // feature ID to be included in the query.
33+ message QueryFeaturesRequest {
34+ // e.g. "driver", "customer", "city".
35+ string entityName = 1 ;
36+ // List of entity ID.
37+ repeated string entityId = 2 ;
38+ // List of feature ID.
5539 // feature ID is in the form of [entity_name].[granularity].[feature_name]
5640 // e.g: "driver.day.total_accepted_booking"
5741 // all requested feature ID shall have same entity name.
58- string featureId = 1 ;
59- // request type either LAST or LIST.
60- // LAST : return only the latest value based on timestamp.
61- // LIST : return list of historical data sorted by timestamp.
62- RequestType type = 2 ;
63- // only applicable to LIST.
64- // length of the returned list <= limit.
65- // default = 0
66- int32 limit = 3 ;
67- }
68-
69- enum RequestType {
70- // LAST : return only the latest value based on timestamp. (default)
71- LAST = 0 ;
72- // LIST : return list of historical data sorted by timestamp.
73- LIST = 1 ;
42+ repeated string featureId = 3 ;
7443}
7544
76- // range of timestamp for querying
77- // valid timestamp range is having start <= end
78- message TimestampRange {
79- // start time of the range query.
80- google.protobuf.Timestamp start = 1 ;
81- // end time of the range query.
82- google.protobuf.Timestamp end = 2 ;
45+ message QueryFeaturesResponse {
46+ // Entity name of the response
47+ string entityName = 1 ;
48+ // map of entity ID and its entity's properties.
49+ map <string , Entity > entities = 2 ;
8350}
8451
8552message Entity {
8653 // map of feature ID and its feature value.
87- map <string , FeatureValueList > features = 1 ;
54+ map <string , FeatureValue > features = 1 ;
8855}
8956
90- message FeatureValueList {
91- // list of feature value
92- // if "type" in "requestDetail" is "LAST", then the length will always be 1.
93- // if "type" in "requestDetail" is "LIST", then the length is <= "limit".
94- feast.types.ValueList valueList = 1 ;
95- // list of timestamp of the value.
96- // the i-th timestamps correspond to the i-th value.
97- feast.types.TimestampList timestampList = 2 ;
57+ message FeatureValue {
58+ // value of feature
59+ feast.types.Value value = 1 ;
60+ // timestamp of the feature
61+ google.protobuf.Timestamp timestamp = 2 ;
9862}
0 commit comments