@google-cloud/discoveryengine 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +7 -1
  3. package/build/protos/google/cloud/discoveryengine/v1/common.proto +30 -2
  4. package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +15 -2
  5. package/build/protos/google/cloud/discoveryengine/v1/conversation.proto +114 -0
  6. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +303 -0
  7. package/build/protos/google/cloud/discoveryengine/v1/document.proto +8 -5
  8. package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +4 -3
  9. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +27 -23
  10. package/build/protos/google/cloud/discoveryengine/v1/schema.proto +1 -1
  11. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +428 -20
  12. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +48 -39
  13. package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +2 -2
  14. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +6 -0
  15. package/build/protos/google/cloud/discoveryengine/v1beta/conversation.proto +9 -2
  16. package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +25 -0
  17. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +115 -3
  18. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +4 -0
  19. package/build/protos/protos.d.ts +10140 -6536
  20. package/build/protos/protos.js +26499 -17277
  21. package/build/protos/protos.json +2311 -1440
  22. package/build/src/index.d.ts +4 -1
  23. package/build/src/index.js +4 -1
  24. package/build/src/v1/completion_service_client.d.ts +156 -6
  25. package/build/src/v1/completion_service_client.js +188 -4
  26. package/build/src/v1/conversational_search_service_client.d.ts +947 -0
  27. package/build/src/v1/conversational_search_service_client.js +1205 -0
  28. package/build/src/v1/conversational_search_service_client_config.json +68 -0
  29. package/build/src/v1/document_service_client.d.ts +165 -18
  30. package/build/src/v1/document_service_client.js +215 -11
  31. package/build/src/v1/index.d.ts +1 -0
  32. package/build/src/v1/index.js +3 -1
  33. package/build/src/v1/schema_service_client.d.ts +148 -4
  34. package/build/src/v1/schema_service_client.js +207 -5
  35. package/build/src/v1/search_service_client.d.ts +238 -28
  36. package/build/src/v1/search_service_client.js +248 -20
  37. package/build/src/v1/user_event_service_client.d.ts +153 -9
  38. package/build/src/v1/user_event_service_client.js +207 -5
  39. package/build/src/v1beta/completion_service_client.d.ts +55 -4
  40. package/build/src/v1beta/completion_service_client.js +60 -4
  41. package/build/src/v1beta/conversational_search_service_client.d.ts +75 -4
  42. package/build/src/v1beta/conversational_search_service_client.js +60 -4
  43. package/build/src/v1beta/document_service_client.d.ts +55 -4
  44. package/build/src/v1beta/document_service_client.js +61 -5
  45. package/build/src/v1beta/recommendation_service_client.d.ts +55 -4
  46. package/build/src/v1beta/recommendation_service_client.js +60 -4
  47. package/build/src/v1beta/schema_service_client.d.ts +55 -4
  48. package/build/src/v1beta/schema_service_client.js +61 -5
  49. package/build/src/v1beta/search_service_client.d.ts +142 -4
  50. package/build/src/v1beta/search_service_client.js +118 -4
  51. package/build/src/v1beta/user_event_service_client.d.ts +55 -4
  52. package/build/src/v1beta/user_event_service_client.js +61 -5
  53. package/package.json +3 -3
@@ -54,11 +54,15 @@ message GcsSource {
54
54
  // document must
55
55
  // have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id].
56
56
  // * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
57
- // `input_uris` will become a document, with the ID set to the first 128
57
+ // `input_uris` becomes a document, with the ID set to the first 128
58
58
  // bits of SHA256(URI) encoded as a hex string.
59
59
  // * `custom`: One custom data JSON per row in arbitrary format that conforms
60
- // the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data
61
- // store. This can only be used by the GENERIC Data Store vertical.
60
+ // to the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the
61
+ // data store. This can only be used by Gen App Builder.
62
+ // * `csv`: A CSV file with header conforming to the defined
63
+ // [Schema][google.cloud.discoveryengine.v1.Schema] of the
64
+ // data store. Each entry after the header is imported as a Document.
65
+ // This can only be used by Gen App Builder.
62
66
  //
63
67
  // Supported values for user even imports:
64
68
  //
@@ -110,9 +114,9 @@ message BigQuerySource {
110
114
  // [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data]
111
115
  // or
112
116
  // [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data].
113
- // * `custom`: One custom data per row in arbitrary format that conforms the
114
- // defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data
115
- // store. This can only be used by the GENERIC Data Store vertical.
117
+ // * `custom`: One custom data per row in arbitrary format that conforms to
118
+ // the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data
119
+ // store. This can only be used by Gen App Builder.
116
120
  string data_schema = 6;
117
121
  }
118
122
 
@@ -121,7 +125,7 @@ message ImportErrorConfig {
121
125
  // Required. Errors destination.
122
126
  oneof destination {
123
127
  // Cloud Storage prefix for import errors. This must be an empty,
124
- // existing Cloud Storage directory. Import errors will be written to
128
+ // existing Cloud Storage directory. Import errors are written to
125
129
  // sharded files in this directory, one per line, as a JSON-encoded
126
130
  // `google.rpc.Status` message.
127
131
  string gcs_prefix = 1;
@@ -136,16 +140,16 @@ message ImportUserEventsRequest {
136
140
  repeated UserEvent user_events = 1 [(google.api.field_behavior) = REQUIRED];
137
141
  }
138
142
 
139
- // The desired input source of the user event data.
143
+ // Required - The desired input source of the user event data.
140
144
  oneof source {
141
- // Required. The Inline source for the input content for UserEvents.
142
- InlineSource inline_source = 2 [(google.api.field_behavior) = REQUIRED];
145
+ // The Inline source for the input content for UserEvents.
146
+ InlineSource inline_source = 2;
143
147
 
144
- // Required. Cloud Storage location for the input content.
145
- GcsSource gcs_source = 3 [(google.api.field_behavior) = REQUIRED];
148
+ // Cloud Storage location for the input content.
149
+ GcsSource gcs_source = 3;
146
150
 
147
- // Required. BigQuery input source.
148
- BigQuerySource bigquery_source = 4 [(google.api.field_behavior) = REQUIRED];
151
+ // BigQuery input source.
152
+ BigQuerySource bigquery_source = 4;
149
153
  }
150
154
 
151
155
  // Required. Parent DataStore resource name, of the form
@@ -181,7 +185,7 @@ message ImportUserEventsResponse {
181
185
  int64 unjoined_events_count = 4;
182
186
  }
183
187
 
184
- // Metadata related to the progress of the Import operation. This will be
188
+ // Metadata related to the progress of the Import operation. This is
185
189
  // returned by the google.longrunning.Operation.metadata field.
186
190
  message ImportUserEventsMetadata {
187
191
  // Operation create time.
@@ -198,8 +202,8 @@ message ImportUserEventsMetadata {
198
202
  int64 failure_count = 4;
199
203
  }
200
204
 
201
- // Metadata related to the progress of the ImportDocuments operation. This will
202
- // be returned by the google.longrunning.Operation.metadata field.
205
+ // Metadata related to the progress of the ImportDocuments operation. This is
206
+ // returned by the google.longrunning.Operation.metadata field.
203
207
  message ImportDocumentsMetadata {
204
208
  // Operation create time.
205
209
  google.protobuf.Timestamp create_time = 1;
@@ -228,7 +232,7 @@ message ImportDocumentsRequest {
228
232
  // Indicates how imported documents are reconciled with the existing documents
229
233
  // created or imported before.
230
234
  enum ReconciliationMode {
231
- // Defaults to INCREMENTAL.
235
+ // Defaults to `INCREMENTAL`.
232
236
  RECONCILIATION_MODE_UNSPECIFIED = 0;
233
237
 
234
238
  // Inserts new documents or updates existing documents.
@@ -280,7 +284,7 @@ message ImportDocumentsRequest {
280
284
  // `false`, [Document.id][google.cloud.discoveryengine.v1.Document.id]s have
281
285
  // to be specified using
282
286
  // [id_field][google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field],
283
- // otherwises, documents without IDs will fail to be imported.
287
+ // otherwise, documents without IDs fail to be imported.
284
288
  //
285
289
  // Only set this field when using
286
290
  // [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or
@@ -288,7 +292,7 @@ message ImportDocumentsRequest {
288
292
  // [GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema]
289
293
  // or
290
294
  // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema]
291
- // is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown.
295
+ // is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
292
296
  bool auto_generate_ids = 8;
293
297
 
294
298
  // The field in the Cloud Storage and BigQuery sources that indicates the
@@ -299,12 +303,12 @@ message ImportDocumentsRequest {
299
303
  // For [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource] it is
300
304
  // the column name of the BigQuery table where the unique ids are stored.
301
305
  //
302
- // The values of the JSON field or the BigQuery column will be used as the
306
+ // The values of the JSON field or the BigQuery column are used as the
303
307
  // [Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field
304
308
  // or the BigQuery column must be of string type, and the values must be set
305
309
  // as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
306
- // with 1-63 characters. Otherwise, documents without valid IDs will fail to
307
- // be imported.
310
+ // with 1-63 characters. Otherwise, documents without valid IDs fail to be
311
+ // imported.
308
312
  //
309
313
  // Only set this field when using
310
314
  // [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or
@@ -40,7 +40,7 @@ message Schema {
40
40
  // Schema representation. One of
41
41
  // [struct_schema][google.cloud.discoveryengine.v1.Schema.struct_schema] or
42
42
  // [json_schema][google.cloud.discoveryengine.v1.Schema.json_schema] should be
43
- // provided otherwise an INVALID_ARGUMENT error is thrown.
43
+ // provided otherwise an `INVALID_ARGUMENT` error is thrown.
44
44
  oneof schema {
45
45
  // The structured representation of the schema.
46
46
  google.protobuf.Struct struct_schema = 2;
@@ -56,6 +56,190 @@ service SearchService {
56
56
  // [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
57
57
  // method.
58
58
  message SearchRequest {
59
+ // Specifies the image query input.
60
+ message ImageQuery {
61
+ oneof image {
62
+ // Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
63
+ // BMP.
64
+ string image_bytes = 1;
65
+ }
66
+ }
67
+
68
+ // A facet specification to perform faceted search.
69
+ message FacetSpec {
70
+ // Specifies how a facet is computed.
71
+ message FacetKey {
72
+ // Required. Supported textual and numerical facet keys in
73
+ // [Document][google.cloud.discoveryengine.v1.Document] object, over which
74
+ // the facet values are computed. Facet key is case-sensitive.
75
+ string key = 1 [(google.api.field_behavior) = REQUIRED];
76
+
77
+ // Set only if values should be bucketed into intervals. Must be set
78
+ // for facets with numerical values. Must not be set for facet with text
79
+ // values. Maximum number of intervals is 30.
80
+ repeated Interval intervals = 2;
81
+
82
+ // Only get facet for the given restricted values. Only supported on
83
+ // textual fields. For example, suppose "category" has three values
84
+ // "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
85
+ // "restricted_values" to "Action > 2022", the "category" facet only
86
+ // contains "Action > 2022". Only supported on textual fields. Maximum
87
+ // is 10.
88
+ repeated string restricted_values = 3;
89
+
90
+ // Only get facet values that start with the given string prefix. For
91
+ // example, suppose "category" has three values "Action > 2022",
92
+ // "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
93
+ // "category" facet only contains "Action > 2022" and "Action > 2021".
94
+ // Only supported on textual fields. Maximum is 10.
95
+ repeated string prefixes = 4;
96
+
97
+ // Only get facet values that contains the given strings. For example,
98
+ // suppose "category" has three values "Action > 2022",
99
+ // "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
100
+ // "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
101
+ // Only supported on textual fields. Maximum is 10.
102
+ repeated string contains = 5;
103
+
104
+ // True to make facet keys case insensitive when getting faceting
105
+ // values with prefixes or contains; false otherwise.
106
+ bool case_insensitive = 6;
107
+
108
+ // The order in which documents are returned.
109
+ //
110
+ // Allowed values are:
111
+ //
112
+ // * "count desc", which means order by
113
+ // [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.count]
114
+ // descending.
115
+ //
116
+ // * "value desc", which means order by
117
+ // [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.value]
118
+ // descending.
119
+ // Only applies to textual facets.
120
+ //
121
+ // If not set, textual values are sorted in [natural
122
+ // order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
123
+ // intervals are sorted in the order given by
124
+ // [FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
125
+ string order_by = 7;
126
+ }
127
+
128
+ // Required. The facet key specification.
129
+ FacetKey facet_key = 1 [(google.api.field_behavior) = REQUIRED];
130
+
131
+ // Maximum of facet values that should be returned for this facet. If
132
+ // unspecified, defaults to 20. The maximum allowed value is 300. Values
133
+ // above 300 are coerced to 300.
134
+ //
135
+ // If this field is negative, an `INVALID_ARGUMENT` is returned.
136
+ int32 limit = 2;
137
+
138
+ // List of keys to exclude when faceting.
139
+ //
140
+ //
141
+ // By default,
142
+ // [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
143
+ // is not excluded from the filter unless it is listed in this field.
144
+ //
145
+ // Listing a facet key in this field allows its values to appear as facet
146
+ // results, even when they are filtered out of search results. Using this
147
+ // field does not affect what search results are returned.
148
+ //
149
+ // For example, suppose there are 100 documents with the color facet "Red"
150
+ // and 200 documents with the color facet "Blue". A query containing the
151
+ // filter "color:ANY("Red")" and having "color" as
152
+ // [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
153
+ // would by default return only "Red" documents in the search results, and
154
+ // also return "Red" with count 100 as the only color facet. Although there
155
+ // are also blue documents available, "Blue" would not be shown as an
156
+ // available facet value.
157
+ //
158
+ // If "color" is listed in "excludedFilterKeys", then the query returns the
159
+ // facet values "Red" with count 100 and "Blue" with count 200, because the
160
+ // "color" key is now excluded from the filter. Because this field doesn't
161
+ // affect search results, the search results are still correctly filtered to
162
+ // return only "Red" documents.
163
+ //
164
+ // A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
165
+ // error is returned.
166
+ repeated string excluded_filter_keys = 3;
167
+
168
+ // Enables dynamic position for this facet. If set to true, the position of
169
+ // this facet among all facets in the response is determined automatically.
170
+ // If dynamic facets are enabled, it is ordered together.
171
+ // If set to false, the position of this facet in the
172
+ // response is the same as in the request, and it is ranked before
173
+ // the facets with dynamic position enable and all dynamic facets.
174
+ //
175
+ // For example, you may always want to have rating facet returned in
176
+ // the response, but it's not necessarily to always display the rating facet
177
+ // at the top. In that case, you can set enable_dynamic_position to true so
178
+ // that the position of rating facet in response is determined
179
+ // automatically.
180
+ //
181
+ // Another example, assuming you have the following facets in the request:
182
+ //
183
+ // * "rating", enable_dynamic_position = true
184
+ //
185
+ // * "price", enable_dynamic_position = false
186
+ //
187
+ // * "brands", enable_dynamic_position = false
188
+ //
189
+ // And also you have a dynamic facets enabled, which generates a facet
190
+ // `gender`. Then the final order of the facets in the response can be
191
+ // ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
192
+ // "rating") depends on how API orders "gender" and "rating" facets.
193
+ // However, notice that "price" and "brands" are always
194
+ // ranked at first and second position because their enable_dynamic_position
195
+ // is false.
196
+ bool enable_dynamic_position = 4;
197
+ }
198
+
199
+ // Boost specification to boost certain documents.
200
+ message BoostSpec {
201
+ // Boost applies to documents which match a condition.
202
+ message ConditionBoostSpec {
203
+ // An expression which specifies a boost condition. The syntax and
204
+ // supported fields are the same as a filter expression. See
205
+ // [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]
206
+ // for detail syntax and limitations.
207
+ //
208
+ // Examples:
209
+ //
210
+ // * To boost documents with document ID "doc_1" or "doc_2", and
211
+ // color
212
+ // "Red" or "Blue":
213
+ // * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
214
+ string condition = 1;
215
+
216
+ // Strength of the condition boost, which should be in [-1, 1]. Negative
217
+ // boost means demotion. Default is 0.0.
218
+ //
219
+ // Setting to 1.0 gives the document a big promotion. However, it does not
220
+ // necessarily mean that the boosted document will be the top result at
221
+ // all times, nor that other documents will be excluded. Results could
222
+ // still be shown even when none of them matches the condition. And
223
+ // results that are significantly more relevant to the search query can
224
+ // still trump your heavily favored but irrelevant documents.
225
+ //
226
+ // Setting to -1.0 gives the document a big demotion. However, results
227
+ // that are deeply relevant might still be shown. The document will have
228
+ // an upstream battle to get a fairly high ranking, but it is not blocked
229
+ // out completely.
230
+ //
231
+ // Setting to 0.0 means no boost applied. The boosting condition is
232
+ // ignored.
233
+ float boost = 2;
234
+ }
235
+
236
+ // Condition boost specifications. If a document matches multiple conditions
237
+ // in the specifictions, boost scores from these specifications are all
238
+ // applied and combined in a non-linear way. Maximum number of
239
+ // specifications is 20.
240
+ repeated ConditionBoostSpec condition_boost_specs = 1;
241
+ }
242
+
59
243
  // Specification to determine under which conditions query expansion should
60
244
  // occur.
61
245
  message QueryExpansionSpec {
@@ -78,6 +262,11 @@ message SearchRequest {
78
262
  // The condition under which query expansion should occur. Default to
79
263
  // [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
80
264
  Condition condition = 1;
265
+
266
+ // Whether to pin unexpanded results. If this field is set to true,
267
+ // unexpanded products are always at the top of the search results, followed
268
+ // by the expanded results.
269
+ bool pin_unexpanded_results = 2;
81
270
  }
82
271
 
83
272
  // The specification for query spell correction.
@@ -106,25 +295,91 @@ message SearchRequest {
106
295
  Mode mode = 1;
107
296
  }
108
297
 
109
- // The specification that configs the desired behavior of the UCS content
110
- // search.
298
+ // A specification for configuring the behavior of content search.
111
299
  message ContentSearchSpec {
112
- // The specification that configs the snippet in the search results.
300
+ // A specification for configuring snippets in a search response.
113
301
  message SnippetSpec {
114
- // Max number of snippets returned in each search result.
115
- // If the matching snippets is less than the max_snippet_count, return all
116
- // of the snippets; otherwise, return the max_snippet_count.
302
+ // [DEPRECATED] This field is deprecated. To control snippet return, use
303
+ // `return_snippet` field. For backwards compatibility, we will return
304
+ // snippet if max_snippet_count > 0.
305
+ int32 max_snippet_count = 1 [deprecated = true];
306
+
307
+ // [DEPRECATED] This field is deprecated and will have no affect on the
308
+ // snippet.
309
+ bool reference_only = 2 [deprecated = true];
310
+
311
+ // If `true`, then return snippet. If no snippet can be generated, we
312
+ // return "No snippet is available for this page." A `snippet_status` with
313
+ // `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
314
+ bool return_snippet = 3;
315
+ }
316
+
317
+ // A specification for configuring a summary returned in a search
318
+ // response.
319
+ message SummarySpec {
320
+ // The number of top results to generate the summary from. If the number
321
+ // of results returned is less than `summaryResultCount`, the summary is
322
+ // generated from all of the results.
117
323
  //
118
- // At most 5 snippets will be returned for each SearchResult.
119
- int32 max_snippet_count = 1;
324
+ // At most five results can be used to generate a summary.
325
+ int32 summary_result_count = 1;
120
326
 
121
- // if true, only snippet reference is returned.
122
- bool reference_only = 2;
327
+ // Specifies whether to include citations in the summary. The default
328
+ // value is `false`.
329
+ //
330
+ // When this field is set to `true`, summaries include in-line citation
331
+ // numbers.
332
+ //
333
+ // Example summary including citations:
334
+ //
335
+ // BigQuery is Google Cloud's fully managed and completely serverless
336
+ // enterprise data warehouse [1]. BigQuery supports all data types, works
337
+ // across clouds, and has built-in machine learning and business
338
+ // intelligence, all within a unified platform [2, 3].
339
+ //
340
+ // The citation numbers refer to the returned search results and are
341
+ // 1-indexed. For example, [1] means that the sentence is attributed to
342
+ // the first search result. [2, 3] means that the sentence is attributed
343
+ // to both the second and third search results.
344
+ bool include_citations = 2;
345
+
346
+ // Specifies whether to filter out adversarial queries. The default value
347
+ // is `false`.
348
+ //
349
+ // Google employs search-query classification to detect adversarial
350
+ // queries. No summary is returned if the search query is classified as an
351
+ // adversarial query. For example, a user might ask a question regarding
352
+ // negative comments about the company or submit a query designed to
353
+ // generate unsafe, policy-violating output. If this field is set to
354
+ // `true`, we skip generating summaries for adversarial queries and return
355
+ // fallback messages instead.
356
+ bool ignore_adversarial_query = 3;
357
+
358
+ // Specifies whether to filter out queries that are not summary-seeking.
359
+ // The default value is `false`.
360
+ //
361
+ // Google employs search-query classification to detect summary-seeking
362
+ // queries. No summary is returned if the search query is classified as a
363
+ // non-summary seeking query. For example, `why is the sky blue` and `Who
364
+ // is the best soccer player in the world?` are summary-seeking queries,
365
+ // but `SFO airport` and `world cup 2026` are not. They are most likely
366
+ // navigational queries. If this field is set to `true`, we skip
367
+ // generating summaries for non-summary seeking queries and return
368
+ // fallback messages instead.
369
+ bool ignore_non_summary_seeking_query = 4;
370
+
371
+ // Language code for Summary. Use language tags defined by
372
+ // [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
373
+ string language_code = 6;
123
374
  }
124
375
 
125
- // If there is no snippet spec provided, there will be no snippet in the
126
- // search result.
376
+ // If `snippetSpec` is not specified, snippets are not included in the
377
+ // search response.
127
378
  SnippetSpec snippet_spec = 1;
379
+
380
+ // If `summarySpec` is not specified, summaries are not included in the
381
+ // search response.
382
+ SummarySpec summary_spec = 2;
128
383
  }
129
384
 
130
385
  // Required. The resource name of the Search serving config, such as
@@ -150,9 +405,12 @@ message SearchRequest {
150
405
  // Raw search query.
151
406
  string query = 3;
152
407
 
408
+ // Raw image query.
409
+ ImageQuery image_query = 19;
410
+
153
411
  // Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to
154
412
  // return. If unspecified, defaults to a reasonable value. The maximum allowed
155
- // value is 100. Values above 100 will be coerced to 100.
413
+ // value is 100. Values above 100 are coerced to 100.
156
414
  //
157
415
  // If this field is negative, an `INVALID_ARGUMENT` is returned.
158
416
  int32 page_size = 4;
@@ -177,11 +435,36 @@ message SearchRequest {
177
435
  // If this field is negative, an `INVALID_ARGUMENT` is returned.
178
436
  int32 offset = 6;
179
437
 
438
+ // The filter syntax consists of an expression language for constructing a
439
+ // predicate from one or more fields of the documents being filtered. Filter
440
+ // expression is case-sensitive.
441
+ //
442
+ // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
443
+ string filter = 7;
444
+
445
+ // The order in which documents are returned. Documents can be ordered by
446
+ // a field in an [Document][google.cloud.discoveryengine.v1.Document] object.
447
+ // Leave it unset if ordered by relevance. `order_by` expression is
448
+ // case-sensitive.
449
+ //
450
+ // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
451
+ string order_by = 8;
452
+
180
453
  // Information about the end user.
181
- // Highly recommended for analytics. The user_agent string in UserInfo will
182
- // be used to deduce device_type for analytics.
454
+ // Highly recommended for analytics.
455
+ // [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
456
+ // is used to deduce `device_type` for analytics.
183
457
  UserInfo user_info = 21;
184
458
 
459
+ // Facet specifications for faceted search. If empty, no facets are returned.
460
+ //
461
+ // A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
462
+ // error is returned.
463
+ repeated FacetSpec facet_specs = 9;
464
+
465
+ // Boost specification to boost certain documents.
466
+ BoostSpec boost_spec = 10;
467
+
185
468
  // Additional search parameters.
186
469
  //
187
470
  // For public website search only, supported values are:
@@ -194,11 +477,11 @@ message SearchRequest {
194
477
  map<string, google.protobuf.Value> params = 11;
195
478
 
196
479
  // The query expansion specification that specifies the conditions under which
197
- // query expansion will occur.
480
+ // query expansion occurs.
198
481
  QueryExpansionSpec query_expansion_spec = 13;
199
482
 
200
483
  // The spell correction specification that specifies the mode under
201
- // which spell correction will take effect.
484
+ // which spell correction takes effect.
202
485
  SpellCorrectionSpec spell_correction_spec = 14;
203
486
 
204
487
  // A unique identifier for tracking visitors. For example, this could be
@@ -217,12 +500,11 @@ message SearchRequest {
217
500
  // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
218
501
  string user_pseudo_id = 15;
219
502
 
220
- // The content search spec that configs the desired behavior of content
221
- // search.
503
+ // A specification for configuring the behavior of content search.
222
504
  ContentSearchSpec content_search_spec = 24;
223
505
 
224
506
  // Whether to turn on safe search. This is only supported for
225
- // [ContentConfig.PUBLIC_WEBSITE][].
507
+ // website search.
226
508
  bool safe_search = 20;
227
509
 
228
510
  // The user labels applied to a resource must meet the following requirements:
@@ -260,9 +542,118 @@ message SearchResponse {
260
542
  Document document = 2;
261
543
  }
262
544
 
545
+ // A facet result.
546
+ message Facet {
547
+ // A facet value which contains value names and their count.
548
+ message FacetValue {
549
+ // A facet value which contains values.
550
+ oneof facet_value {
551
+ // Text value of a facet, such as "Black" for facet "colors".
552
+ string value = 1;
553
+
554
+ // Interval value for a facet, such as [10, 20) for facet "price". It
555
+ // matches
556
+ // [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
557
+ Interval interval = 2;
558
+ }
559
+
560
+ // Number of items that have this facet value.
561
+ int64 count = 3;
562
+ }
563
+
564
+ // The key for this facet. E.g., "colors" or "price". It matches
565
+ // [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key].
566
+ string key = 1;
567
+
568
+ // The facet values for this field.
569
+ repeated FacetValue values = 2;
570
+
571
+ // Whether the facet is dynamically generated.
572
+ bool dynamic_facet = 3;
573
+ }
574
+
575
+ // Summary of the top N search result specified by the summary spec.
576
+ message Summary {
577
+ // Safety Attribute categories and their associated confidence scores.
578
+ message SafetyAttributes {
579
+ // The display names of Safety Attribute categories associated with the
580
+ // generated content. Order matches the Scores.
581
+ repeated string categories = 1;
582
+
583
+ // The confidence scores of the each category, higher
584
+ // value means higher confidence. Order matches the Categories.
585
+ repeated float scores = 2;
586
+ }
587
+
588
+ // An Enum for summary-skipped reasons.
589
+ enum SummarySkippedReason {
590
+ // Default value. The summary skipped reason is not specified.
591
+ SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0;
592
+
593
+ // The adversarial query ignored case.
594
+ //
595
+ // Only populated when
596
+ // [SummarySpec.ignore_adversarial_query][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ignore_adversarial_query]
597
+ // is set to `true`.
598
+ ADVERSARIAL_QUERY_IGNORED = 1;
599
+
600
+ // The non-summary seeking query ignored case.
601
+ //
602
+ // Only populated when
603
+ // [SummarySpec.ignore_non_summary_seeking_query][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_summary_seeking_query]
604
+ // is set to `true`.
605
+ NON_SUMMARY_SEEKING_QUERY_IGNORED = 2;
606
+
607
+ // The out-of-domain query ignored case.
608
+ //
609
+ // Google skips the summary if there are no high-relevance search results.
610
+ // For example, the data store contains facts about company A but the
611
+ // user query is asking questions about company B.
612
+ OUT_OF_DOMAIN_QUERY_IGNORED = 3;
613
+
614
+ // The potential policy violation case.
615
+ //
616
+ // Google skips the summary if there is a potential policy violation
617
+ // detected. This includes content that may be violent or toxic.
618
+ POTENTIAL_POLICY_VIOLATION = 4;
619
+
620
+ // The LLM addon not enabled case.
621
+ //
622
+ // Google skips the summary if the LLM addon is not enabled.
623
+ LLM_ADDON_NOT_ENABLED = 5;
624
+ }
625
+
626
+ // The summary content.
627
+ string summary_text = 1;
628
+
629
+ // Additional summary-skipped reasons. This provides the reason for ignored
630
+ // cases. If nothing is skipped, this field is not set.
631
+ repeated SummarySkippedReason summary_skipped_reasons = 2;
632
+
633
+ // A collection of Safety Attribute categories and their associated
634
+ // confidence scores.
635
+ SafetyAttributes safety_attributes = 3;
636
+ }
637
+
638
+ // Information describing query expansion including whether expansion has
639
+ // occurred.
640
+ message QueryExpansionInfo {
641
+ // Bool describing whether query expansion has occurred.
642
+ bool expanded_query = 1;
643
+
644
+ // Number of pinned results. This field will only be set when expansion
645
+ // happens and
646
+ // [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
647
+ // is set to true.
648
+ int64 pinned_result_count = 2;
649
+ }
650
+
263
651
  // A list of matched documents. The order represents the ranking.
264
652
  repeated SearchResult results = 1;
265
653
 
654
+ // Results of facets requested by user.
655
+ repeated Facet facets = 2;
656
+
266
657
  // The estimated total count of matched items irrespective of pagination. The
267
658
  // count of [results][google.cloud.discoveryengine.v1.SearchResponse.results]
268
659
  // returned by pagination may be less than the
@@ -276,6 +667,14 @@ message SearchResponse {
276
667
  // performance.
277
668
  string attribution_token = 4;
278
669
 
670
+ // The URI of a customer-defined redirect page. If redirect action is
671
+ // triggered, no search is performed, and only
672
+ // [redirect_uri][google.cloud.discoveryengine.v1.SearchResponse.redirect_uri]
673
+ // and
674
+ // [attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token]
675
+ // are set in the response.
676
+ string redirect_uri = 12;
677
+
279
678
  // A token that can be sent as
280
679
  // [SearchRequest.page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token]
281
680
  // to retrieve the next page. If this field is omitted, there are no
@@ -286,4 +685,13 @@ message SearchResponse {
286
685
  // is AUTOMATIC, then the search results are based on corrected_query.
287
686
  // Otherwise the original query is used for search.
288
687
  string corrected_query = 7;
688
+
689
+ // A summary as part of the search results.
690
+ // This field is only returned if
691
+ // [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
692
+ // is set.
693
+ Summary summary = 9;
694
+
695
+ // Query expansion information for the returned results.
696
+ QueryExpansionInfo query_expansion_info = 14;
289
697
  }