Skip to content

Commit 8692273

Browse files
Google APIscopybara-github
authored andcommitted
feat: add conversational search
feat: add tile navigation docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 683821729
1 parent d01eb46 commit 8692273

13 files changed

Lines changed: 813 additions & 7 deletions

google/cloud/retail/v2beta/BUILD.bazel

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
# * extra_protoc_file_parameters
1010
# The complete list of preserved parameters can be found in the source code.
1111

12+
# buildifier: disable=load-on-top
13+
1214
# This is an API workspace, having public visibility by default makes perfect sense.
1315
package(default_visibility = ["//visibility:public"])
1416

1517
##############################################################################
1618
# Common
1719
##############################################################################
18-
load("@rules_proto//proto:defs.bzl", "proto_library")
20+
# buildifier: disable=same-origin-load
1921
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
22+
load("@rules_proto//proto:defs.bzl", "proto_library")
2023

2124
proto_library(
2225
name = "retail_proto",
@@ -29,12 +32,16 @@ proto_library(
2932
"control.proto",
3033
"control_service.proto",
3134
"export_config.proto",
35+
"generative_question.proto",
36+
"generative_question_service.proto",
3237
"import_config.proto",
3338
"model.proto",
3439
"model_service.proto",
3540
"prediction_service.proto",
3641
"product.proto",
3742
"product_service.proto",
43+
"project.proto",
44+
"project_service.proto",
3845
"promotion.proto",
3946
"purge_config.proto",
4047
"search_service.proto",
@@ -66,12 +73,14 @@ proto_library_with_info(
6673
deps = [
6774
":retail_proto",
6875
"//google/cloud:common_resources_proto",
76+
"//google/cloud/location:location_proto",
6977
],
7078
)
7179

7280
##############################################################################
7381
# Java
7482
##############################################################################
83+
# buildifier: disable=same-origin-load
7584
load(
7685
"@com_google_googleapis_imports//:imports.bzl",
7786
"java_gapic_assembly_gradle_pkg",
@@ -101,11 +110,13 @@ java_gapic_library(
101110
service_yaml = "retail_v2beta.yaml",
102111
test_deps = [
103112
":retail_java_grpc",
113+
"//google/cloud/location:location_java_grpc",
104114
],
105115
transport = "grpc+rest",
106116
deps = [
107117
":retail_java_proto",
108118
"//google/api:api_java_proto",
119+
"//google/cloud/location:location_java_proto",
109120
],
110121
)
111122

@@ -120,12 +131,16 @@ java_gapic_test(
120131
"com.google.cloud.retail.v2beta.CompletionServiceClientTest",
121132
"com.google.cloud.retail.v2beta.ControlServiceClientHttpJsonTest",
122133
"com.google.cloud.retail.v2beta.ControlServiceClientTest",
134+
"com.google.cloud.retail.v2beta.GenerativeQuestionServiceClientHttpJsonTest",
135+
"com.google.cloud.retail.v2beta.GenerativeQuestionServiceClientTest",
123136
"com.google.cloud.retail.v2beta.ModelServiceClientHttpJsonTest",
124137
"com.google.cloud.retail.v2beta.ModelServiceClientTest",
125138
"com.google.cloud.retail.v2beta.PredictionServiceClientHttpJsonTest",
126139
"com.google.cloud.retail.v2beta.PredictionServiceClientTest",
127140
"com.google.cloud.retail.v2beta.ProductServiceClientHttpJsonTest",
128141
"com.google.cloud.retail.v2beta.ProductServiceClientTest",
142+
"com.google.cloud.retail.v2beta.ProjectServiceClientHttpJsonTest",
143+
"com.google.cloud.retail.v2beta.ProjectServiceClientTest",
129144
"com.google.cloud.retail.v2beta.SearchServiceClientHttpJsonTest",
130145
"com.google.cloud.retail.v2beta.SearchServiceClientTest",
131146
"com.google.cloud.retail.v2beta.ServingConfigServiceClientHttpJsonTest",
@@ -152,6 +167,7 @@ java_gapic_assembly_gradle_pkg(
152167
##############################################################################
153168
# Go
154169
##############################################################################
170+
# buildifier: disable=same-origin-load
155171
load(
156172
"@com_google_googleapis_imports//:imports.bzl",
157173
"go_gapic_assembly_pkg",
@@ -186,6 +202,7 @@ go_gapic_library(
186202
deps = [
187203
":retail_go_proto",
188204
"//google/api:httpbody_go_proto",
205+
"//google/cloud/location:location_go_proto",
189206
"//google/longrunning:longrunning_go_proto",
190207
"@com_google_cloud_go_longrunning//:go_default_library",
191208
"@com_google_cloud_go_longrunning//autogen:go_default_library",
@@ -209,6 +226,7 @@ go_gapic_assembly_pkg(
209226
##############################################################################
210227
# Python
211228
##############################################################################
229+
# buildifier: disable=same-origin-load
212230
load(
213231
"@com_google_googleapis_imports//:imports.bzl",
214232
"py_gapic_assembly_pkg",
@@ -223,6 +241,8 @@ py_gapic_library(
223241
rest_numeric_enums = True,
224242
service_yaml = "retail_v2beta.yaml",
225243
transport = "grpc+rest",
244+
deps = [
245+
],
226246
)
227247

228248
py_test(
@@ -246,6 +266,7 @@ py_gapic_assembly_pkg(
246266
##############################################################################
247267
# PHP
248268
##############################################################################
269+
# buildifier: disable=same-origin-load
249270
load(
250271
"@com_google_googleapis_imports//:imports.bzl",
251272
"php_gapic_assembly_pkg",
@@ -262,10 +283,13 @@ php_gapic_library(
262283
name = "retail_php_gapic",
263284
srcs = [":retail_proto_with_info"],
264285
grpc_service_config = "retail_grpc_service_config.json",
286+
migration_mode = "PRE_MIGRATION_SURFACE_ONLY",
265287
rest_numeric_enums = True,
266288
service_yaml = "retail_v2beta.yaml",
267289
transport = "grpc+rest",
268-
deps = [":retail_php_proto"],
290+
deps = [
291+
":retail_php_proto",
292+
],
269293
)
270294

271295
# Open Source Packages
@@ -280,6 +304,7 @@ php_gapic_assembly_pkg(
280304
##############################################################################
281305
# Node.js
282306
##############################################################################
307+
# buildifier: disable=same-origin-load
283308
load(
284309
"@com_google_googleapis_imports//:imports.bzl",
285310
"nodejs_gapic_assembly_pkg",
@@ -311,6 +336,7 @@ nodejs_gapic_assembly_pkg(
311336
##############################################################################
312337
# Ruby
313338
##############################################################################
339+
# buildifier: disable=same-origin-load
314340
load(
315341
"@com_google_googleapis_imports//:imports.bzl",
316342
"ruby_cloud_gapic_library",
@@ -365,6 +391,7 @@ ruby_gapic_assembly_pkg(
365391
##############################################################################
366392
# C#
367393
##############################################################################
394+
# buildifier: disable=same-origin-load
368395
load(
369396
"@com_google_googleapis_imports//:imports.bzl",
370397
"csharp_gapic_assembly_pkg",
@@ -375,6 +402,7 @@ load(
375402

376403
csharp_proto_library(
377404
name = "retail_csharp_proto",
405+
extra_opts = [],
378406
deps = [":retail_proto"],
379407
)
380408

@@ -411,6 +439,7 @@ csharp_gapic_assembly_pkg(
411439
##############################################################################
412440
# C++
413441
##############################################################################
442+
# buildifier: disable=same-origin-load
414443
load(
415444
"@com_google_googleapis_imports//:imports.bzl",
416445
"cc_grpc_library",

google/cloud/retail/v2beta/common.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ message Rule {
339339
}
340340

341341
// Each instance corresponds to a force return attribute for the given
342-
// condition. There can't be more 3 instances here.
342+
// condition. There can't be more 15 instances here.
343343
repeated FacetPositionAdjustment facet_position_adjustments = 1;
344344
}
345345

google/cloud/retail/v2beta/completion_service.proto

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ message CompleteQueryRequest {
151151
// capped by 20.
152152
int32 max_suggestions = 5;
153153

154-
// If true, attribute suggestions are enabled and provided in response.
154+
// If true, attribute suggestions are enabled and provided in the response.
155155
//
156-
// This field is only available for "cloud-retail" dataset.
156+
// This field is only available for the "cloud-retail" dataset.
157157
bool enable_attribute_suggestions = 9;
158158

159159
// The entity for customers who run multiple entities, domains, sites, or
@@ -192,6 +192,12 @@ message CompleteQueryResponse {
192192
string recent_search = 1;
193193
}
194194

195+
// Resource that represents attribute results.
196+
// The list of suggestions for the attribute.
197+
message AttributeResult {
198+
repeated string suggestions = 1;
199+
}
200+
195201
// Results of the matching suggestions. The result list is ordered and the
196202
// first result is top suggestion.
197203
repeated CompletionResult completion_results = 1;
@@ -224,4 +230,14 @@ message CompleteQueryResponse {
224230
// Recent searches are deduplicated. More recent searches will be reserved
225231
// when duplication happens.
226232
repeated RecentSearchResult recent_search_results = 3 [deprecated = true];
233+
234+
// A map of matched attribute suggestions. This field is only available for
235+
// "cloud-retail" dataset.
236+
//
237+
// Current supported keys:
238+
//
239+
// * `brands`
240+
//
241+
// * `categories`
242+
map<string, AttributeResult> attribute_results = 4;
227243
}

google/cloud/retail/v2beta/export_config.proto

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,117 @@ message ExportErrorsConfig {
8181
}
8282
}
8383

84+
// Request message for ExportProducts method.
85+
message ExportProductsRequest {
86+
// Required. Resource name of a [Branch][google.cloud.retail.v2beta.Branch],
87+
// and `default_branch` for branch_id component is supported. For example
88+
// `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
89+
string parent = 1 [
90+
(google.api.field_behavior) = REQUIRED,
91+
(google.api.resource_reference) = { type: "retail.googleapis.com/Branch" }
92+
];
93+
94+
// Required. The output location of the data.
95+
OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED];
96+
97+
// A filtering expression to specify restrictions on returned events.
98+
// The expression is a sequence of terms. Each term applies a restriction to
99+
// the returned products. Use this expression to restrict results to a
100+
// specific time range, tag, or stock state or to filter products by product
101+
// type.
102+
// For example, `lastModifiedTime > "2012-04-23T18:25:43.511Z"
103+
// lastModifiedTime<"2012-04-23T18:25:43.511Z" productType=primary`
104+
//
105+
// We expect only four types of fields:
106+
//
107+
// * `lastModifiedTime`: This can be specified twice, once with a
108+
// less than operator and once with a greater than operator. The
109+
// `lastModifiedTime` restriction should result in one, contiguous,
110+
// valid, last-modified, time range.
111+
//
112+
// * `productType`: Supported values are `primary` and `variant`. The
113+
// Boolean operators `OR` and `NOT` are supported if the expression is
114+
// enclosed in parentheses and must be separated from the
115+
// `productType` values by a space.
116+
//
117+
// * `availability`: Supported values are `IN_STOCK`, `OUT_OF_STOCK`,
118+
// `PREORDER`, and `BACKORDER`. Boolean operators `OR` and `NOT` are
119+
// supported if the expression is enclosed in parentheses and must be
120+
// separated from the `availability` values by a space.
121+
//
122+
// * `Tag expressions`: Restricts output to products that match all of the
123+
// specified tags. Boolean operators `OR` and `NOT` are supported if the
124+
// expression is enclosed in parentheses and the operators are separated
125+
// from the tag values by a space. Also supported is '`-"tagA"`', which
126+
// is equivalent to '`NOT "tagA"`'. Tag values must be double-quoted,
127+
// UTF-8 encoded strings and have a size limit of 1,000 characters.
128+
//
129+
// Some examples of valid filters expressions:
130+
//
131+
// * Example 1: `lastModifiedTime > "2012-04-23T18:25:43.511Z"
132+
// lastModifiedTime < "2012-04-23T18:30:43.511Z"`
133+
// * Example 2: `lastModifiedTime > "2012-04-23T18:25:43.511Z"
134+
// productType = "variant"`
135+
// * Example 3: `tag=("Red" OR "Blue") tag="New-Arrival"
136+
// tag=(NOT "promotional")
137+
// productType = "primary" lastModifiedTime <
138+
// "2018-04-23T18:30:43.511Z"`
139+
// * Example 4: `lastModifiedTime > "2012-04-23T18:25:43.511Z"`
140+
// * Example 5: `availability = (IN_STOCK OR BACKORDER)`
141+
string filter = 3;
142+
}
143+
144+
// Request message for the `ExportUserEvents` method.
145+
message ExportUserEventsRequest {
146+
// Required. Resource name of a [Catalog][google.cloud.retail.v2beta.Catalog].
147+
// For example `projects/1234/locations/global/catalogs/default_catalog`
148+
string parent = 1 [
149+
(google.api.field_behavior) = REQUIRED,
150+
(google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
151+
];
152+
153+
// Required. The output location of the data.
154+
OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED];
155+
156+
// A filtering expression to specify restrictions on returned events.
157+
// The expression is a sequence of terms. Each term applies a restriction to
158+
// the returned user events. Use this expression to restrict results to a
159+
// specific time range or to filter events by eventType.
160+
// For example, `eventTime > "2012-04-23T18:25:43.511Z"
161+
// eventsMissingCatalogItems eventTime<"2012-04-23T18:25:43.511Z"
162+
// eventType=search`
163+
//
164+
// We expect only three types of fields:
165+
//
166+
// * `eventTime`: This can be specified twice, once with a
167+
// less than operator and once with a greater than operator. The
168+
// `eventTime` restriction should result in one, contiguous, valid,
169+
// `eventTime` range.
170+
//
171+
// * `eventType`: Boolean operators `OR` and `NOT` are supported if the
172+
// expression is enclosed in parentheses and the operators are separated
173+
// from the tag values by a space.
174+
//
175+
// * `eventsMissingCatalogItems`: This restricts results
176+
// to events for which catalog items were not found in the catalog. The
177+
// default behavior is to return only those events for which catalog
178+
// items were found.
179+
//
180+
// Some examples of valid filters expressions:
181+
//
182+
// * Example 1: `eventTime > "2012-04-23T18:25:43.511Z"
183+
// eventTime < "2012-04-23T18:30:43.511Z"`
184+
// * Example 2: `eventTime > "2012-04-23T18:25:43.511Z"
185+
// eventType = detail-page-view`
186+
// * Example 3: `eventsMissingCatalogItems
187+
// eventType = (NOT search) eventTime <
188+
// "2018-04-23T18:30:43.511Z"`
189+
// * Example 4: `eventTime > "2012-04-23T18:25:43.511Z"`
190+
// * Example 5: `eventType = (detail-page-view OR search)`
191+
// * Example 6: `eventsMissingCatalogItems`
192+
string filter = 3;
193+
}
194+
84195
// Request message for the `ExportAnalyticsMetrics` method.
85196
message ExportAnalyticsMetricsRequest {
86197
// Required. Full resource name of the parent catalog.

0 commit comments

Comments
 (0)