Skip to content

Commit 6d09280

Browse files
Google APIscopybara-github
authored andcommitted
feat: add a user_attributes field in SearchRequest that can be used for personalization
feat: add a model_scores field in SearchResponse.results to expose model quality signals feat: data_source_id replaces primary_feed_id in MerchantCenterFeedFilter PiperOrigin-RevId: 763884353
1 parent 9a49a7d commit 6d09280

8 files changed

Lines changed: 80 additions & 47 deletions

google/cloud/retail/v2alpha/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ load(
413413

414414
csharp_proto_library(
415415
name = "retail_csharp_proto",
416-
extra_opts = [],
417416
deps = [":retail_proto"],
418417
)
419418

google/cloud/retail/v2alpha/catalog.proto

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,11 @@ message MerchantCenterLink {
553553
// Merchant Center Feed filter criterion.
554554
message MerchantCenterFeedFilter {
555555
// Merchant Center primary feed ID.
556-
int64 primary_feed_id = 1;
556+
// Deprecated: use data_source_id instead.
557+
int64 primary_feed_id = 1 [deprecated = true];
558+
559+
// AFM data source ID.
560+
int64 data_source_id = 3;
557561

558562
// Merchant Center primary feed name. The name is used for the display
559563
// purposes only.

google/cloud/retail/v2alpha/catalog_service.proto

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -59,39 +59,39 @@ service CatalogService {
5959
}
6060

6161
// Set a specified branch id as default branch. API methods such as
62-
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
63-
// [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct],
64-
// [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
65-
// will treat requests using "default_branch" to the actual branch id set as
66-
// default.
62+
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
63+
// [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct],
64+
// [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
65+
// will treat requests using "default_branch" to the actual branch id set as
66+
// default.
6767
//
68-
// For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as
69-
// default, setting
70-
// [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch]
71-
// to `projects/*/locations/*/catalogs/*/branches/default_branch` is
72-
// equivalent to setting
73-
// [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch]
74-
// to `projects/*/locations/*/catalogs/*/branches/1`.
68+
// For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as
69+
// default, setting
70+
// [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to
71+
// `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent
72+
// to setting
73+
// [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to
74+
// `projects/*/locations/*/catalogs/*/branches/1`.
7575
//
76-
// Using multiple branches can be useful when developers would like
77-
// to have a staging branch to test and verify for future usage. When it
78-
// becomes ready, developers switch on the staging branch using this API
79-
// while keeping using
80-
// `projects/*/locations/*/catalogs/*/branches/default_branch` as
81-
// [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch]
82-
// to route the traffic to this staging branch.
76+
// Using multiple branches can be useful when developers would like
77+
// to have a staging branch to test and verify for future usage. When it
78+
// becomes ready, developers switch on the staging branch using this API
79+
// while keeping using
80+
// `projects/*/locations/*/catalogs/*/branches/default_branch` as
81+
// [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to
82+
// route the traffic to this staging branch.
8383
//
84-
// CAUTION: If you have live predict/search traffic, switching the default
85-
// branch could potentially cause outages if the ID space of the new branch
86-
// is very different from the old one.
84+
// CAUTION: If you have live predict/search traffic, switching the default
85+
// branch could potentially cause outages if the ID space of the new branch
86+
// is very different from the old one.
8787
//
88-
// More specifically:
88+
// More specifically:
8989
//
90-
// * PredictionService will only return product IDs from branch {newBranch}.
91-
// * SearchService will only return product IDs from branch {newBranch}
92-
// (if branch is not explicitly set).
93-
// * UserEventService will only join events with products from branch
94-
// {newBranch}.
90+
// * PredictionService will only return product IDs from branch {newBranch}.
91+
// * SearchService will only return product IDs from branch {newBranch}
92+
// (if branch is not explicitly set).
93+
// * UserEventService will only join events with products from branch
94+
// {newBranch}.
9595
rpc SetDefaultBranch(SetDefaultBranchRequest)
9696
returns (google.protobuf.Empty) {
9797
option (google.api.http) = {
@@ -102,8 +102,8 @@ service CatalogService {
102102
}
103103

104104
// Get which branch is currently default branch set by
105-
// [CatalogService.SetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.SetDefaultBranch]
106-
// method under a specified parent catalog.
105+
// [CatalogService.SetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.SetDefaultBranch]
106+
// method under a specified parent catalog.
107107
rpc GetDefaultBranch(GetDefaultBranchRequest)
108108
returns (GetDefaultBranchResponse) {
109109
option (google.api.http) = {

google/cloud/retail/v2alpha/common.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,3 +990,15 @@ message PinControlMetadata {
990990
// keyed by pin position.
991991
map<int64, ProductPins> dropped_pins = 2;
992992
}
993+
994+
// A list of string values.
995+
message StringList {
996+
// String values.
997+
repeated string values = 1;
998+
}
999+
1000+
// A message with a list of double values.
1001+
message DoubleList {
1002+
// The list of double values.
1003+
repeated double values = 1;
1004+
}

google/cloud/retail/v2alpha/conversational_search_service.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ message ConversationalSearchResponse {
225225
// The conversational followup question generated for Intent refinement.
226226
message FollowupQuestion {
227227
// Suggested answers to the follow-up question.
228+
// If it's numerical attribute, only ProductAttributeInterval will be set.
229+
// If it's textual attribute, only productAttributeValue will be set.
228230
message SuggestedAnswer {
229231
// Product attribute value, including an attribute key and an
230232
// attribute value. Other types can be added here in the future.

google/cloud/retail/v2alpha/merchant_center_account_link.proto

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ message MerchantCenterAccountLink {
4141
// Merchant Center Feed filter criterion.
4242
message MerchantCenterFeedFilter {
4343
// Merchant Center primary feed ID.
44-
int64 primary_feed_id = 1;
44+
// Deprecated: use data_source_id instead.
45+
int64 primary_feed_id = 1 [deprecated = true];
46+
47+
// AFM data source ID.
48+
int64 data_source_id = 3;
4549

4650
// Merchant Center primary feed name. The name is used for the display
4751
// purposes only.

google/cloud/retail/v2alpha/retail_v2alpha.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@ documentation:
6565
Recommendations. These discovery AI solutions help you implement
6666
personalized search, browse and recommendations, based on machine learning
6767
models, across your websites and mobile applications.
68-
rules:
69-
- selector: google.cloud.location.Locations.GetLocation
70-
description: Gets information about a location.
71-
72-
- selector: google.cloud.location.Locations.ListLocations
73-
description: Lists information about the supported locations for this service.
7468
7569
http:
7670
rules:
@@ -89,14 +83,6 @@ http:
8983

9084
authentication:
9185
rules:
92-
- selector: google.cloud.location.Locations.GetLocation
93-
oauth:
94-
canonical_scopes: |-
95-
https://www.googleapis.com/auth/cloud-platform
96-
- selector: google.cloud.location.Locations.ListLocations
97-
oauth:
98-
canonical_scopes: |-
99-
https://www.googleapis.com/auth/cloud-platform
10086
- selector: google.cloud.retail.v2alpha.AnalyticsService.ExportAnalyticsMetrics
10187
oauth:
10288
canonical_scopes: |-

google/cloud/retail/v2alpha/search_service.proto

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,29 @@ message SearchRequest {
922922
// [LocalInventory.place_id][google.cloud.retail.v2alpha.LocalInventory.place_id]
923923
// for revenue optimization.
924924
string place_id = 46 [(google.api.field_behavior) = OPTIONAL];
925+
926+
// Optional. The user attributes that could be used for personalization of
927+
// search results.
928+
// * Populate at most 100 key-value pairs per query.
929+
// * Only supports string keys and repeated string values.
930+
// * Duplcate keys are not allowed within a single query.
931+
//
932+
// Example:
933+
// user_attributes: [
934+
// { key: "pets"
935+
// value {
936+
// values: "dog"
937+
// values: "cat"
938+
// }
939+
// },
940+
// { key: "state"
941+
// value {
942+
// values: "CA"
943+
// }
944+
// }
945+
// ]
946+
map<string, StringList> user_attributes = 47
947+
[(google.api.field_behavior) = OPTIONAL];
925948
}
926949

927950
// Response message for
@@ -1016,6 +1039,9 @@ message SearchResponse {
10161039
//
10171040
// * `purchased`: Indicates that this product has been purchased before.
10181041
repeated string personal_labels = 7;
1042+
1043+
// Google provided available scores.
1044+
map<string, DoubleList> model_scores = 8;
10191045
}
10201046

10211047
// A facet result.

0 commit comments

Comments
 (0)