@@ -19,6 +19,7 @@ package google.cloud.retail.v2;
1919import "google/api/annotations.proto" ;
2020import "google/api/client.proto" ;
2121import "google/api/field_behavior.proto" ;
22+ import "google/api/resource.proto" ;
2223import "google/cloud/retail/v2/user_event.proto" ;
2324import "google/protobuf/struct.proto" ;
2425
@@ -42,21 +43,30 @@ service PredictionService {
4243 option (google.api.http ) = {
4344 post : "/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:predict"
4445 body : "*"
46+ additional_bindings {
47+ post : "/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:predict"
48+ body : "*"
49+ }
4550 };
4651 }
4752}
4853
4954// Request message for Predict method.
5055message PredictRequest {
5156 // Required. Full resource name of the format:
52- // {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
53- // The ID of the Recommendations AI placement. Before you can request
54- // predictions from your model, you must create at least one placement for it.
55- // For more information, see [Managing
56- // placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
57+ // `{placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*}`
58+ // or
59+ // `{placement=projects/*/locations/global/catalogs/default_catalog/placements/*}`.
60+ // We recommend using the `servingConfigs` resource. `placements` is a legacy
61+ // resource.
62+ // The ID of the Recommendations AI serving config or placement.
63+ // Before you can request predictions from your model, you must create at
64+ // least one serving config or placement for it. For more information, see
65+ // [Managing serving configurations]
66+ // (https://cloud.google.com/retail/docs/manage-configs).
5767 //
58- // The full list of available placements can be seen at
59- // https://console.cloud.google.com/recommendation/ catalogs/default_catalog/placements
68+ // The full list of available serving configs can be seen at
69+ // https://console.cloud.google.com/ai/retail/ catalogs/default_catalog/configs
6070 string placement = 1 [(google.api.field_behavior ) = REQUIRED ];
6171
6272 // Required. Context about the user, what they are looking at and what action
@@ -75,14 +85,14 @@ message PredictRequest {
7585 // [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] unset.
7686 UserEvent user_event = 2 [(google.api.field_behavior ) = REQUIRED ];
7787
78- // Maximum number of results to return per page . Set this property
79- // to the number of prediction results needed. If zero, the service will
80- // choose a reasonable default. The maximum allowed value is 100. Values
81- // above 100 will be coerced to 100.
88+ // Maximum number of results to return. Set this property to the number of
89+ // prediction results needed. If zero, the service will choose a reasonable
90+ // default. The maximum allowed value is 100. Values above 100 will be coerced
91+ // to 100.
8292 int32 page_size = 3 ;
8393
84- // The previous PredictResponse.next_page_token .
85- string page_token = 4 ;
94+ // This field is not used; leave it unset .
95+ string page_token = 4 [ deprecated = true ] ;
8696
8797 // Filter for restricting prediction results with a length limit of 5,000
8898 // characters. Accepts values for tags and the `filterOutOfStockItems` flag.
@@ -113,6 +123,14 @@ message PredictRequest {
113123 // receive empty results instead.
114124 // Note that the API will never return items with storageStatus of "EXPIRED"
115125 // or "DELETED" regardless of filter choices.
126+ //
127+ // If `filterSyntaxV2` is set to true under the `params` field, then
128+ // attribute-based expressions are expected instead of the above described
129+ // tag-based syntax. Examples:
130+ //
131+ // * (colors: ANY("Red", "Blue")) AND NOT (categories: ANY("Phones"))
132+ // * (availability: ANY("IN_STOCK")) AND
133+ // (colors: ANY("Red") OR categories: ANY("Phones"))
116134 string filter = 5 ;
117135
118136 // Use validate only mode for this prediction query. If set to true, a
@@ -146,6 +164,8 @@ message PredictRequest {
146164 // 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
147165 // request-level control and adjusts prediction results based on product
148166 // category.
167+ // * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter`
168+ // field is interpreteted according to the new, attribute-based syntax.
149169 map <string , google.protobuf.Value > params = 7 ;
150170
151171 // The labels applied to a resource must meet the following requirements:
0 commit comments