Skip to content

Commit 139f56e

Browse files
Google APIscopybara-github
authored andcommitted
feat: support case insensitive match on search facets
feat: allow to return min/max values on search numeric facets feat: allow to use serving configs as an alias of placements docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 464560246
1 parent c52559c commit 139f56e

7 files changed

Lines changed: 238 additions & 148 deletions

File tree

google/cloud/retail/v2/common.proto

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,8 @@ message Interval {
219219
// The lower bound of the interval. If neither of the min fields are set, then
220220
// the lower bound is negative infinity.
221221
//
222-
// This field must be not larger than
223-
// [max][google.cloud.retail.v2.Interval.max]. Otherwise, an INVALID_ARGUMENT
224-
// error is returned.
222+
// This field must not be larger than max.
223+
// Otherwise, an INVALID_ARGUMENT error is returned.
225224
oneof min {
226225
// Inclusive lower bound.
227226
double minimum = 1;
@@ -233,9 +232,8 @@ message Interval {
233232
// The upper bound of the interval. If neither of the max fields are set, then
234233
// the upper bound is positive infinity.
235234
//
236-
// This field must be not smaller than
237-
// [min][google.cloud.retail.v2.Interval.min]. Otherwise, an INVALID_ARGUMENT
238-
// error is returned.
235+
// This field must be not smaller than min.
236+
// Otherwise, an INVALID_ARGUMENT error is returned.
239237
oneof max {
240238
// Inclusive upper bound.
241239
double maximum = 3;

google/cloud/retail/v2/completion_service.proto

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ message CompleteQueryRequest {
9999
// characters. Otherwise, an INVALID_ARGUMENT error is returned.
100100
string visitor_id = 7;
101101

102+
// Note that this field applies for `user-data` dataset only. For requests
103+
// with `cloud-retail` dataset, setting this field has no effect.
104+
//
102105
// The language filters applied to the output suggestions. If set, it should
103106
// contain the language of the query. If not set, suggestions are returned
104107
// without considering language restrictions. This is the BCP-47 language
@@ -159,8 +162,9 @@ message CompleteQueryResponse {
159162
// ingested through BigQuery.
160163
//
161164
// * For "cloud-retail", the attributes are product attributes generated
162-
// by Cloud Retail. This is an experimental feature. Contact Retail Search
163-
// support team if you are interested in enabling it.
165+
// by Cloud Retail. It requires
166+
// [UserEvent.product_details][google.cloud.retail.v2.UserEvent.product_details]
167+
// is imported properly.
164168
map<string, CustomAttribute> attributes = 2;
165169
}
166170

@@ -195,7 +199,7 @@ message CompleteQueryResponse {
195199
// [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
196200
// case insensitively.
197201
//
198-
// * They are transformed to lower cases.
202+
// * They are transformed to lower case.
199203
//
200204
// * They are UTF-8 safe.
201205
//

google/cloud/retail/v2/prediction_service.proto

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package google.cloud.retail.v2;
1919
import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
22+
import "google/api/resource.proto";
2223
import "google/cloud/retail/v2/user_event.proto";
2324
import "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.
5055
message 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

Comments
 (0)