Skip to content

Commit c24e836

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: 683821659
1 parent f5caeef commit c24e836

15 files changed

Lines changed: 608 additions & 12 deletions

google/cloud/retail/v2alpha/BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ proto_library(
3434
"control.proto",
3535
"control_service.proto",
3636
"export_config.proto",
37+
"generative_question.proto",
38+
"generative_question_service.proto",
3739
"import_config.proto",
3840
"merchant_center_account_link.proto",
3941
"merchant_center_account_link_service.proto",
@@ -135,6 +137,8 @@ java_gapic_test(
135137
"com.google.cloud.retail.v2alpha.CompletionServiceClientTest",
136138
"com.google.cloud.retail.v2alpha.ControlServiceClientHttpJsonTest",
137139
"com.google.cloud.retail.v2alpha.ControlServiceClientTest",
140+
"com.google.cloud.retail.v2alpha.GenerativeQuestionServiceClientHttpJsonTest",
141+
"com.google.cloud.retail.v2alpha.GenerativeQuestionServiceClientTest",
138142
"com.google.cloud.retail.v2alpha.MerchantCenterAccountLinkServiceClientHttpJsonTest",
139143
"com.google.cloud.retail.v2alpha.MerchantCenterAccountLinkServiceClientTest",
140144
"com.google.cloud.retail.v2alpha.ModelServiceClientHttpJsonTest",
@@ -406,7 +410,6 @@ load(
406410

407411
csharp_proto_library(
408412
name = "retail_csharp_proto",
409-
extra_opts = [],
410413
deps = [":retail_proto"],
411414
)
412415

google/cloud/retail/v2alpha/branch.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ enum BranchView {
4545
BRANCH_VIEW_FULL = 2;
4646
}
4747

48-
// A data branch that stores [Product][google.cloud.retail.v2alpha.Product]s.
48+
// A data branch that stores all instances of
49+
// [Product][google.cloud.retail.v2alpha.Product]s.
4950
message Branch {
5051
option (google.api.resource) = {
5152
type: "retail.googleapis.com/Branch"

google/cloud/retail/v2alpha/branch_service.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ service BranchService {
4343
option (google.api.oauth_scopes) =
4444
"https://www.googleapis.com/auth/cloud-platform";
4545

46-
// Lists all [Branch][google.cloud.retail.v2alpha.Branch]s under the specified
47-
// parent [Catalog][google.cloud.retail.v2alpha.Catalog].
46+
// Lists all instances of [Branch][google.cloud.retail.v2alpha.Branch] under
47+
// the specified parent [Catalog][google.cloud.retail.v2alpha.Catalog].
4848
rpc ListBranches(ListBranchesRequest) returns (ListBranchesResponse) {
4949
option (google.api.http) = {
5050
get: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/branches"

google/cloud/retail/v2alpha/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/v2alpha/completion_service.proto

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

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

160160
// The entity for customers who run multiple entities, domains, sites, or
@@ -208,8 +208,8 @@ message CompleteQueryResponse {
208208
}
209209

210210
// Resource that represents attribute results.
211+
// The list of suggestions for the attribute.
211212
message AttributeResult {
212-
// The list of suggestions for the attribute.
213213
repeated string suggestions = 1;
214214
}
215215

google/cloud/retail/v2alpha/export_config.proto

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

84+
// Request message for ExportProducts method.
85+
message ExportProductsRequest {
86+
// Required. Resource name of a [Branch][google.cloud.retail.v2alpha.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
147+
// [Catalog][google.cloud.retail.v2alpha.Catalog]. For example
148+
// `projects/1234/locations/global/catalogs/default_catalog`
149+
string parent = 1 [
150+
(google.api.field_behavior) = REQUIRED,
151+
(google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
152+
];
153+
154+
// Required. The output location of the data.
155+
OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED];
156+
157+
// A filtering expression to specify restrictions on returned events.
158+
// The expression is a sequence of terms. Each term applies a restriction to
159+
// the returned user events. Use this expression to restrict results to a
160+
// specific time range or to filter events by eventType.
161+
// For example, `eventTime > "2012-04-23T18:25:43.511Z"
162+
// eventsMissingCatalogItems eventTime<"2012-04-23T18:25:43.511Z"
163+
// eventType=search`
164+
//
165+
// We expect only three types of fields:
166+
//
167+
// * `eventTime`: This can be specified twice, once with a
168+
// less than operator and once with a greater than operator. The
169+
// `eventTime` restriction should result in one, contiguous, valid,
170+
// `eventTime` range.
171+
//
172+
// * `eventType`: Boolean operators `OR` and `NOT` are supported if the
173+
// expression is enclosed in parentheses and the operators are separated
174+
// from the tag values by a space.
175+
//
176+
// * `eventsMissingCatalogItems`: This restricts results
177+
// to events for which catalog items were not found in the catalog. The
178+
// default behavior is to return only those events for which catalog
179+
// items were found.
180+
//
181+
// Some examples of valid filters expressions:
182+
//
183+
// * Example 1: `eventTime > "2012-04-23T18:25:43.511Z"
184+
// eventTime < "2012-04-23T18:30:43.511Z"`
185+
// * Example 2: `eventTime > "2012-04-23T18:25:43.511Z"
186+
// eventType = detail-page-view`
187+
// * Example 3: `eventsMissingCatalogItems
188+
// eventType = (NOT search) eventTime <
189+
// "2018-04-23T18:30:43.511Z"`
190+
// * Example 4: `eventTime > "2012-04-23T18:25:43.511Z"`
191+
// * Example 5: `eventType = (detail-page-view OR search)`
192+
// * Example 6: `eventsMissingCatalogItems`
193+
string filter = 3;
194+
}
195+
84196
// Request message for the `ExportAnalyticsMetrics` method.
85197
message ExportAnalyticsMetricsRequest {
86198
// Required. Full resource name of the parent catalog.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Copyright 2024 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.cloud.retail.v2alpha;
18+
19+
import "google/api/field_behavior.proto";
20+
21+
option csharp_namespace = "Google.Cloud.Retail.V2Alpha";
22+
option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb";
23+
option java_multiple_files = true;
24+
option java_outer_classname = "GenerativeQuestionProto";
25+
option java_package = "com.google.cloud.retail.v2alpha";
26+
option objc_class_prefix = "RETAIL";
27+
option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
28+
option ruby_package = "Google::Cloud::Retail::V2alpha";
29+
30+
// Configuration for overall generative question feature state.
31+
message GenerativeQuestionsFeatureConfig {
32+
// Required. Resource name of the affected catalog.
33+
// Format: projects/{project}/locations/{location}/catalogs/{catalog}
34+
string catalog = 1 [(google.api.field_behavior) = REQUIRED];
35+
36+
// Optional. Determines whether questions will be used at serving time.
37+
// Note: This feature cannot be enabled until initial data requirements are
38+
// satisfied.
39+
bool feature_enabled = 2 [(google.api.field_behavior) = OPTIONAL];
40+
41+
// Optional. Minimum number of products in the response to trigger follow-up
42+
// questions. Value must be 0 or positive.
43+
int32 minimum_products = 3 [(google.api.field_behavior) = OPTIONAL];
44+
}
45+
46+
// Configuration for a single generated question.
47+
message GenerativeQuestionConfig {
48+
// Required. Resource name of the catalog.
49+
// Format: projects/{project}/locations/{location}/catalogs/{catalog}
50+
string catalog = 1 [(google.api.field_behavior) = REQUIRED];
51+
52+
// Required. The facet to which the question is associated.
53+
string facet = 2 [(google.api.field_behavior) = REQUIRED];
54+
55+
// Output only. The LLM generated question.
56+
string generated_question = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
57+
58+
// Optional. The question that will be used at serving time.
59+
// Question can have a max length of 300 bytes.
60+
// When not populated, generated_question should be used.
61+
string final_question = 4 [(google.api.field_behavior) = OPTIONAL];
62+
63+
// Output only. Values that can be used to answer the question.
64+
repeated string example_values = 5
65+
[(google.api.field_behavior) = OUTPUT_ONLY];
66+
67+
// Output only. The ratio of how often a question was asked.
68+
float frequency = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
69+
70+
// Optional. Whether the question is asked at serving time.
71+
bool allowed_in_conversation = 7 [(google.api.field_behavior) = OPTIONAL];
72+
}

0 commit comments

Comments
 (0)