Skip to content

Commit 6517e3b

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 PiperOrigin-RevId: 861314205
1 parent 03e7731 commit 6517e3b

File tree

4 files changed

+252
-2
lines changed

4 files changed

+252
-2
lines changed
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
# This file was automatically generated by BuildFileGenerator
2+
3+
# buildifier: disable=load-on-top
4+
5+
# This is an API workspace, having public visibility by default makes perfect sense.
6+
package(default_visibility = ["//visibility:public"])
7+
8+
##############################################################################
9+
# Common
10+
##############################################################################
11+
load("@rules_proto//proto:defs.bzl", "proto_library")
12+
13+
proto_library(
14+
name = "logging_proto",
15+
srcs = [
16+
"error_log.proto",
17+
],
18+
deps = [
19+
"//google/rpc:status_proto",
20+
"@com_google_protobuf//:struct_proto",
21+
],
22+
)
23+
24+
##############################################################################
25+
# Java
26+
##############################################################################
27+
# buildifier: disable=same-origin-load
28+
load(
29+
"@com_google_googleapis_imports//:imports.bzl",
30+
"java_proto_library",
31+
"java_gapic_assembly_gradle_pkg",
32+
)
33+
34+
java_proto_library(
35+
name = "logging_java_proto",
36+
deps = [":logging_proto"],
37+
)
38+
39+
# Open Source Packages
40+
java_gapic_assembly_gradle_pkg(
41+
name = "google-cloud-retail-logging-java",
42+
deps = [
43+
":logging_proto",
44+
":logging_java_proto",
45+
],
46+
)
47+
48+
##############################################################################
49+
# Go
50+
##############################################################################
51+
# buildifier: disable=same-origin-load
52+
load(
53+
"@com_google_googleapis_imports//:imports.bzl",
54+
"go_proto_library",
55+
"go_gapic_assembly_pkg",
56+
)
57+
58+
go_proto_library(
59+
name = "logging_go_proto",
60+
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
61+
importpath = "cloud.google.com/go/retail/logging/loggingpb",
62+
protos = [":logging_proto"],
63+
deps = [
64+
"//google/rpc:status_go_proto",
65+
],
66+
)
67+
68+
go_gapic_assembly_pkg(
69+
name = "google-cloud-retail-logging-go",
70+
deps = [
71+
":logging_go_proto",
72+
],
73+
)
74+
75+
##############################################################################
76+
# Python
77+
##############################################################################
78+
# buildifier: disable=same-origin-load
79+
load(
80+
"@com_google_googleapis_imports//:imports.bzl",
81+
"moved_proto_library",
82+
"py_grpc_library",
83+
"py_proto_library",
84+
"py_gapic_library",
85+
"py_gapic_assembly_pkg",
86+
)
87+
88+
moved_proto_library(
89+
name = "logging_moved_proto",
90+
srcs = [":logging_proto"],
91+
deps = [
92+
"//google/rpc:status_proto",
93+
"@com_google_protobuf//:struct_proto",
94+
],
95+
)
96+
97+
py_proto_library(
98+
name = "logging_py_proto",
99+
deps = [":logging_moved_proto"],
100+
)
101+
102+
py_grpc_library(
103+
name = "logging_py_grpc",
104+
srcs = [":logging_moved_proto"],
105+
deps = [":logging_py_proto"],
106+
)
107+
108+
py_gapic_library(
109+
name = "logging_py_gapic",
110+
srcs = [":logging_proto"],
111+
rest_numeric_enums = False,
112+
transport = "grpc+rest",
113+
)
114+
115+
# Open Source Packages
116+
py_gapic_assembly_pkg(
117+
name = "google-cloud-retail-logging-py",
118+
deps = [
119+
":logging_py_gapic",
120+
],
121+
)
122+
123+
##############################################################################
124+
# PHP
125+
##############################################################################
126+
# buildifier: disable=same-origin-load
127+
load(
128+
"@com_google_googleapis_imports//:imports.bzl",
129+
"php_gapic_assembly_pkg",
130+
"php_proto_library",
131+
)
132+
133+
php_proto_library(
134+
name = "logging_php_proto",
135+
deps = [":logging_proto"],
136+
)
137+
138+
php_gapic_assembly_pkg(
139+
name = "google-cloud-retail-logging-php",
140+
deps = [
141+
":logging_php_proto",
142+
],
143+
)
144+
145+
##############################################################################
146+
# Ruby
147+
##############################################################################
148+
# buildifier: disable=same-origin-load
149+
load(
150+
"@com_google_googleapis_imports//:imports.bzl",
151+
"ruby_grpc_library",
152+
"ruby_proto_library",
153+
)
154+
155+
ruby_proto_library(
156+
name = "logging_ruby_proto",
157+
deps = [":logging_proto"],
158+
)
159+
160+
ruby_grpc_library(
161+
name = "logging_ruby_grpc",
162+
srcs = [":logging_proto"],
163+
deps = [":logging_ruby_proto"],
164+
)
165+
166+
##############################################################################
167+
# C#
168+
##############################################################################
169+
# buildifier: disable=same-origin-load
170+
load(
171+
"@com_google_googleapis_imports//:imports.bzl",
172+
"csharp_proto_library",
173+
"csharp_gapic_assembly_pkg",
174+
)
175+
176+
csharp_proto_library(
177+
name = "logging_csharp_proto",
178+
deps = [":logging_proto"],
179+
)
180+
181+
# Open Source Packages
182+
csharp_gapic_assembly_pkg(
183+
name = "google-cloud-retail-logging-csharp",
184+
package_name = "Google.Cloud.Retail.Logging",
185+
generate_nongapic_package = True,
186+
deps = [
187+
":logging_csharp_proto",
188+
],
189+
)
190+
191+
##############################################################################
192+
# C++
193+
##############################################################################
194+
# buildifier: disable=same-origin-load
195+
load(
196+
"@com_google_googleapis_imports//:imports.bzl",
197+
"cc_grpc_library",
198+
"cc_proto_library",
199+
)
200+
201+
cc_proto_library(
202+
name = "logging_cc_proto",
203+
deps = [":logging_proto"],
204+
)
205+
206+
cc_grpc_library(
207+
name = "logging_cc_grpc",
208+
srcs = [":logging_proto"],
209+
grpc_only = True,
210+
deps = [":logging_cc_proto"],
211+
)

google/cloud/retail/v2beta/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ java_grpc_library(
106106
java_gapic_library(
107107
name = "retail_java_gapic",
108108
srcs = [":retail_proto_with_info"],
109+
gapic_yaml = None,
109110
grpc_service_config = "retail_grpc_service_config.json",
110111
rest_numeric_enums = True,
111112
service_yaml = "retail_v2beta.yaml",
@@ -402,7 +403,6 @@ load(
402403

403404
csharp_proto_library(
404405
name = "retail_csharp_proto",
405-
extra_opts = [],
406406
deps = [":retail_proto"],
407407
)
408408

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+
}

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.

0 commit comments

Comments
 (0)