Skip to content

Commit 1a182cc

Browse files
feat: [retail] add conversational search (#5740)
* feat: add conversational search feat: add tile navigation docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 683821659 Source-Link: googleapis/googleapis@c24e836 Source-Link: googleapis/googleapis-gen@5d6e6b6 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJldGFpbC8uT3dsQm90LnlhbWwiLCJoIjoiNWQ2ZTZiNmU3MzRlMjU0MDlkYzc0ZTcxMTJkZjBjNzY0ZmRmYzM3NSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add conversational search feat: add tile navigation docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 683821686 Source-Link: googleapis/googleapis@d01eb46 Source-Link: googleapis/googleapis-gen@1db3459 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJldGFpbC8uT3dsQm90LnlhbWwiLCJoIjoiMWRiMzQ1OWYzZGZhOTM0N2E1ODExZDcyYjEyZTE3MTRkYTc1ZWQ5MyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add conversational search feat: add tile navigation docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 683821729 Source-Link: googleapis/googleapis@8692273 Source-Link: googleapis/googleapis-gen@02b9449 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJldGFpbC8uT3dsQm90LnlhbWwiLCJoIjoiMDJiOTQ0OTk3MzhhNDFhNTYyZjE1Mjc2MmRhYzM1Nzc3MzVhZGJjZiJ9 * 🦉 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 8c61279 commit 1a182cc

156 files changed

Lines changed: 151378 additions & 99788 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/google-cloud-retail/README.md

Lines changed: 23 additions & 2 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ message Rule {
337337
}
338338

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

packages/google-cloud-retail/protos/google/cloud/retail/v2/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
}
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.v2;
18+
19+
import "google/api/field_behavior.proto";
20+
21+
option csharp_namespace = "Google.Cloud.Retail.V2";
22+
option go_package = "cloud.google.com/go/retail/apiv2/retailpb;retailpb";
23+
option java_multiple_files = true;
24+
option java_outer_classname = "GenerativeQuestionProto";
25+
option java_package = "com.google.cloud.retail.v2";
26+
option objc_class_prefix = "RETAIL";
27+
option php_namespace = "Google\\Cloud\\Retail\\V2";
28+
option ruby_package = "Google::Cloud::Retail::V2";
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+
}
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
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.v2;
18+
19+
import "google/api/annotations.proto";
20+
import "google/api/client.proto";
21+
import "google/api/field_behavior.proto";
22+
import "google/api/resource.proto";
23+
import "google/cloud/retail/v2/generative_question.proto";
24+
import "google/protobuf/field_mask.proto";
25+
26+
option csharp_namespace = "Google.Cloud.Retail.V2";
27+
option go_package = "cloud.google.com/go/retail/apiv2/retailpb;retailpb";
28+
option java_multiple_files = true;
29+
option java_outer_classname = "GenerativeQuestionServiceProto";
30+
option java_package = "com.google.cloud.retail.v2";
31+
option objc_class_prefix = "RETAIL";
32+
option php_namespace = "Google\\Cloud\\Retail\\V2";
33+
option ruby_package = "Google::Cloud::Retail::V2";
34+
35+
// Service for managing LLM generated questions in search serving.
36+
service GenerativeQuestionService {
37+
option (google.api.default_host) = "retail.googleapis.com";
38+
option (google.api.oauth_scopes) =
39+
"https://www.googleapis.com/auth/cloud-platform";
40+
41+
// Manages overal generative question feature state -- enables toggling
42+
// feature on and off.
43+
rpc UpdateGenerativeQuestionsFeatureConfig(
44+
UpdateGenerativeQuestionsFeatureConfigRequest)
45+
returns (GenerativeQuestionsFeatureConfig) {
46+
option (google.api.http) = {
47+
patch: "/v2/{generative_questions_feature_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature"
48+
body: "generative_questions_feature_config"
49+
};
50+
option (google.api.method_signature) =
51+
"generative_questions_feature_config,update_mask";
52+
}
53+
54+
// Manages overal generative question feature state -- enables toggling
55+
// feature on and off.
56+
rpc GetGenerativeQuestionsFeatureConfig(
57+
GetGenerativeQuestionsFeatureConfigRequest)
58+
returns (GenerativeQuestionsFeatureConfig) {
59+
option (google.api.http) = {
60+
get: "/v2/{catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature"
61+
};
62+
option (google.api.method_signature) = "catalog";
63+
}
64+
65+
// Returns all questions for a given catalog.
66+
rpc ListGenerativeQuestionConfigs(ListGenerativeQuestionConfigsRequest)
67+
returns (ListGenerativeQuestionConfigsResponse) {
68+
option (google.api.http) = {
69+
get: "/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestions"
70+
};
71+
option (google.api.method_signature) = "parent";
72+
}
73+
74+
// Allows management of individual questions.
75+
rpc UpdateGenerativeQuestionConfig(UpdateGenerativeQuestionConfigRequest)
76+
returns (GenerativeQuestionConfig) {
77+
option (google.api.http) = {
78+
patch: "/v2/{generative_question_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestion"
79+
body: "generative_question_config"
80+
};
81+
option (google.api.method_signature) =
82+
"generative_question_config,update_mask";
83+
}
84+
85+
// Allows management of multiple questions.
86+
rpc BatchUpdateGenerativeQuestionConfigs(
87+
BatchUpdateGenerativeQuestionConfigsRequest)
88+
returns (BatchUpdateGenerativeQuestionConfigsResponse) {
89+
option (google.api.http) = {
90+
post: "/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestion:batchUpdate"
91+
body: "*"
92+
};
93+
option (google.api.method_signature) = "parent,requests";
94+
}
95+
}
96+
97+
// Request for UpdateGenerativeQuestionsFeatureConfig method.
98+
message UpdateGenerativeQuestionsFeatureConfigRequest {
99+
// Required. The configuration managing the feature state.
100+
GenerativeQuestionsFeatureConfig generative_questions_feature_config = 2
101+
[(google.api.field_behavior) = REQUIRED];
102+
103+
// Optional. Indicates which fields in the provided
104+
// [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig]
105+
// to update. If not set or empty, all supported fields are updated.
106+
google.protobuf.FieldMask update_mask = 4
107+
[(google.api.field_behavior) = OPTIONAL];
108+
}
109+
110+
// Request for GetGenerativeQuestionsFeatureConfig method.
111+
message GetGenerativeQuestionsFeatureConfigRequest {
112+
// Required. Resource name of the parent catalog.
113+
// Format: projects/{project}/locations/{location}/catalogs/{catalog}
114+
string catalog = 1 [
115+
(google.api.field_behavior) = REQUIRED,
116+
(google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
117+
];
118+
}
119+
120+
// Request for ListQuestions method.
121+
message ListGenerativeQuestionConfigsRequest {
122+
// Required. Resource name of the parent catalog.
123+
// Format: projects/{project}/locations/{location}/catalogs/{catalog}
124+
string parent = 1 [
125+
(google.api.field_behavior) = REQUIRED,
126+
(google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
127+
];
128+
}
129+
130+
// Response for ListQuestions method.
131+
message ListGenerativeQuestionConfigsResponse {
132+
// All the questions for a given catalog.
133+
repeated GenerativeQuestionConfig generative_question_configs = 1;
134+
}
135+
136+
// Request for UpdateGenerativeQuestionConfig method.
137+
message UpdateGenerativeQuestionConfigRequest {
138+
// Required. The question to update.
139+
GenerativeQuestionConfig generative_question_config = 3
140+
[(google.api.field_behavior) = REQUIRED];
141+
142+
// Optional. Indicates which fields in the provided
143+
// [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig]
144+
// to update. The following are NOT supported:
145+
//
146+
// * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency]
147+
//
148+
// If not set or empty, all supported fields are updated.
149+
google.protobuf.FieldMask update_mask = 4
150+
[(google.api.field_behavior) = OPTIONAL];
151+
}
152+
153+
// Request for BatchUpdateGenerativeQuestionConfig method.
154+
message BatchUpdateGenerativeQuestionConfigsRequest {
155+
// Optional. Resource name of the parent catalog.
156+
// Format: projects/{project}/locations/{location}/catalogs/{catalog}
157+
string parent = 1 [
158+
(google.api.field_behavior) = OPTIONAL,
159+
(google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
160+
];
161+
162+
// Required. The updates question configs.
163+
repeated UpdateGenerativeQuestionConfigRequest requests = 2
164+
[(google.api.field_behavior) = REQUIRED];
165+
}
166+
167+
// Aggregated response for UpdateGenerativeQuestionConfig method.
168+
message BatchUpdateGenerativeQuestionConfigsResponse {
169+
// Optional. The updates question configs.
170+
repeated GenerativeQuestionConfig generative_question_configs = 1
171+
[(google.api.field_behavior) = OPTIONAL];
172+
}

packages/google-cloud-retail/protos/google/cloud/retail/v2/product.proto

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,15 @@ message Product {
380380
// Default to
381381
// [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK].
382382
//
383+
// For primary products with variants set the availability of the primary as
384+
// [Availability.OUT_OF_STOCK][google.cloud.retail.v2.Product.Availability.OUT_OF_STOCK]
385+
// and set the true availability at the variant level. This way the primary
386+
// product will be considered "in stock" as long as it has at least one
387+
// variant in stock.
388+
//
389+
// For primary products with no variants set the true availability at the
390+
// primary level.
391+
//
383392
// Corresponding properties: Google Merchant Center property
384393
// [availability](https://support.google.com/merchants/answer/6324448).
385394
// Schema.org property [Offer.availability](https://schema.org/availability).
@@ -553,8 +562,6 @@ message Product {
553562
// * [name][google.cloud.retail.v2.Product.name]
554563
// * [color_info][google.cloud.retail.v2.Product.color_info]
555564
//
556-
// The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
557-
// returned.
558565
//
559566
// Note: Returning more fields in
560567
// [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase

0 commit comments

Comments
 (0)