xref: /aosp_15_r20/external/googleapis/google/cloud/recommendationengine/v1beta1/common.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2020 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.recommendationengine.v1beta1;
18
19
20option csharp_namespace = "Google.Cloud.RecommendationEngine.V1Beta1";
21option go_package = "cloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb";
22option java_multiple_files = true;
23option java_package = "com.google.cloud.recommendationengine.v1beta1";
24option objc_class_prefix = "RECAI";
25option php_namespace = "Google\\Cloud\\RecommendationEngine\\V1beta1";
26option ruby_package = "Google::Cloud::RecommendationEngine::V1beta1";
27
28// FeatureMap represents extra features that customers want to include in the
29// recommendation model for catalogs/user events as categorical/numerical
30// features.
31message FeatureMap {
32  // A list of string features.
33  message StringList {
34    // String feature value with a length limit of 128 bytes.
35    repeated string value = 1;
36  }
37
38  // A list of float features.
39  message FloatList {
40    // Float feature value.
41    repeated float value = 1;
42  }
43
44  // Categorical features that can take on one of a limited number of possible
45  // values. Some examples would be the brand/maker of a product, or country of
46  // a customer.
47  //
48  // Feature names and values must be UTF-8 encoded strings.
49  //
50  // For example: `{ "colors": {"value": ["yellow", "green"]},
51  //                 "sizes": {"value":["S", "M"]}`
52  map<string, StringList> categorical_features = 1;
53
54  // Numerical features. Some examples would be the height/weight of a product,
55  // or age of a customer.
56  //
57  // Feature names must be UTF-8 encoded strings.
58  //
59  // For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
60  //                 "heights_cm": {"value":[8.1, 6.4]} }`
61  map<string, FloatList> numerical_features = 2;
62}
63