Skip to content

Commit f470c6f

Browse files
feat: [retail] add a user_attributes field in SearchRequest that can be used for personalization (#7041)
* 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 PiperOrigin-RevId: 861314205 Source-Link: googleapis/googleapis@6517e3b Source-Link: googleapis/googleapis-gen@91c423f Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJldGFpbC8uT3dsQm90LnlhbWwiLCJoIjoiOTFjNDIzZjI0YzE0ZTg5ZWU0ZTU1NDRlYTQwMzdkNWI3MjA4YjFlYyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 2190178 commit f470c6f

8 files changed

Lines changed: 947 additions & 3 deletions

File tree

packages/google-cloud-retail/protos/google/cloud/retail/v2beta/common.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,3 +943,15 @@ message PinControlMetadata {
943943
// keyed by pin position.
944944
map<int64, ProductPins> dropped_pins = 2;
945945
}
946+
947+
// A list of string values.
948+
message StringList {
949+
// String values.
950+
repeated string values = 1;
951+
}
952+
953+
// A message with a list of double values.
954+
message DoubleList {
955+
// The list of double values.
956+
repeated double values = 1;
957+
}

packages/google-cloud-retail/protos/google/cloud/retail/v2beta/search_service.proto

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ message SearchRequest {
431431
// [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
432432
Condition condition = 1;
433433

434-
// Whether to pin unexpanded results. If this field is set to true,
434+
// Whether to pin unexpanded results. The default value is false. If this
435+
// field is set to true,
435436
// unexpanded products are always at the top of the search results, followed
436437
// by the expanded results.
437438
bool pin_unexpanded_results = 2;
@@ -882,6 +883,29 @@ message SearchRequest {
882883
// [LocalInventory.place_id][google.cloud.retail.v2beta.LocalInventory.place_id]
883884
// for revenue optimization.
884885
string place_id = 46 [(google.api.field_behavior) = OPTIONAL];
886+
887+
// Optional. The user attributes that could be used for personalization of
888+
// search results.
889+
// * Populate at most 100 key-value pairs per query.
890+
// * Only supports string keys and repeated string values.
891+
// * Duplicate keys are not allowed within a single query.
892+
//
893+
// Example:
894+
// user_attributes: [
895+
// { key: "pets"
896+
// value {
897+
// values: "dog"
898+
// values: "cat"
899+
// }
900+
// },
901+
// { key: "state"
902+
// value {
903+
// values: "CA"
904+
// }
905+
// }
906+
// ]
907+
map<string, StringList> user_attributes = 47
908+
[(google.api.field_behavior) = OPTIONAL];
885909
}
886910

887911
// Response message for
@@ -976,6 +1000,9 @@ message SearchResponse {
9761000
//
9771001
// * `purchased`: Indicates that this product has been purchased before.
9781002
repeated string personal_labels = 7;
1003+
1004+
// Google provided available scores.
1005+
map<string, DoubleList> model_scores = 8;
9791006
}
9801007

9811008
// A facet result.

packages/google-cloud-retail/protos/protos.d.ts

Lines changed: 206 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)