google-cloud-discovery_engine-v1 0.1.0 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +23 -3
- data/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +23 -3
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +959 -0
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb +176 -0
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +797 -0
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +450 -0
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1/document_service/client.rb +23 -8
- data/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +23 -8
- data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +42 -0
- data/lib/google/cloud/discovery_engine/v1/rest.rb +2 -1
- data/lib/google/cloud/discovery_engine/v1/schema_service/client.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +42 -0
- data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +45 -9
- data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +47 -12
- data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +19 -5
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +19 -5
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +42 -0
- data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1/common_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/conversation_pb.rb +54 -0
- data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +61 -0
- data/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb +67 -0
- data/lib/google/cloud/discoveryengine/v1/import_config_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +13 -1
- data/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +14 -0
- data/proto_docs/google/cloud/discoveryengine/v1/common.rb +19 -2
- data/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb +15 -2
- data/proto_docs/google/cloud/discoveryengine/v1/conversation.rb +113 -0
- data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +206 -0
- data/proto_docs/google/cloud/discoveryengine/v1/document.rb +8 -5
- data/proto_docs/google/cloud/discoveryengine/v1/document_service.rb +4 -3
- data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +23 -19
- data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +455 -19
- data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +44 -32
- data/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb +1 -1
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- metadata +36 -3
@@ -40,11 +40,14 @@ module Google
|
|
40
40
|
# @!attribute [rw] query
|
41
41
|
# @return [::String]
|
42
42
|
# Raw search query.
|
43
|
+
# @!attribute [rw] image_query
|
44
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery]
|
45
|
+
# Raw image query.
|
43
46
|
# @!attribute [rw] page_size
|
44
47
|
# @return [::Integer]
|
45
48
|
# Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to
|
46
49
|
# return. If unspecified, defaults to a reasonable value. The maximum allowed
|
47
|
-
# value is 100. Values above 100
|
50
|
+
# value is 100. Values above 100 are coerced to 100.
|
48
51
|
#
|
49
52
|
# If this field is negative, an `INVALID_ARGUMENT` is returned.
|
50
53
|
# @!attribute [rw] page_token
|
@@ -67,11 +70,36 @@ module Google
|
|
67
70
|
# unset.
|
68
71
|
#
|
69
72
|
# If this field is negative, an `INVALID_ARGUMENT` is returned.
|
73
|
+
# @!attribute [rw] filter
|
74
|
+
# @return [::String]
|
75
|
+
# The filter syntax consists of an expression language for constructing a
|
76
|
+
# predicate from one or more fields of the documents being filtered. Filter
|
77
|
+
# expression is case-sensitive.
|
78
|
+
#
|
79
|
+
# If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
|
80
|
+
# @!attribute [rw] order_by
|
81
|
+
# @return [::String]
|
82
|
+
# The order in which documents are returned. Documents can be ordered by
|
83
|
+
# a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object.
|
84
|
+
# Leave it unset if ordered by relevance. `order_by` expression is
|
85
|
+
# case-sensitive.
|
86
|
+
#
|
87
|
+
# If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
|
70
88
|
# @!attribute [rw] user_info
|
71
89
|
# @return [::Google::Cloud::DiscoveryEngine::V1::UserInfo]
|
72
90
|
# Information about the end user.
|
73
|
-
# Highly recommended for analytics.
|
74
|
-
#
|
91
|
+
# Highly recommended for analytics.
|
92
|
+
# {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent}
|
93
|
+
# is used to deduce `device_type` for analytics.
|
94
|
+
# @!attribute [rw] facet_specs
|
95
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec>]
|
96
|
+
# Facet specifications for faceted search. If empty, no facets are returned.
|
97
|
+
#
|
98
|
+
# A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
|
99
|
+
# error is returned.
|
100
|
+
# @!attribute [rw] boost_spec
|
101
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
|
102
|
+
# Boost specification to boost certain documents.
|
75
103
|
# @!attribute [rw] params
|
76
104
|
# @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
|
77
105
|
# Additional search parameters.
|
@@ -86,11 +114,11 @@ module Google
|
|
86
114
|
# @!attribute [rw] query_expansion_spec
|
87
115
|
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec]
|
88
116
|
# The query expansion specification that specifies the conditions under which
|
89
|
-
# query expansion
|
117
|
+
# query expansion occurs.
|
90
118
|
# @!attribute [rw] spell_correction_spec
|
91
119
|
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec]
|
92
120
|
# The spell correction specification that specifies the mode under
|
93
|
-
# which spell correction
|
121
|
+
# which spell correction takes effect.
|
94
122
|
# @!attribute [rw] user_pseudo_id
|
95
123
|
# @return [::String]
|
96
124
|
# A unique identifier for tracking visitors. For example, this could be
|
@@ -109,12 +137,11 @@ module Google
|
|
109
137
|
# characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
110
138
|
# @!attribute [rw] content_search_spec
|
111
139
|
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec]
|
112
|
-
#
|
113
|
-
# search.
|
140
|
+
# A specification for configuring the behavior of content search.
|
114
141
|
# @!attribute [rw] safe_search
|
115
142
|
# @return [::Boolean]
|
116
143
|
# Whether to turn on safe search. This is only supported for
|
117
|
-
#
|
144
|
+
# website search.
|
118
145
|
# @!attribute [rw] user_labels
|
119
146
|
# @return [::Google::Protobuf::Map{::String => ::String}]
|
120
147
|
# The user labels applied to a resource must meet the following requirements:
|
@@ -138,12 +165,214 @@ module Google
|
|
138
165
|
include ::Google::Protobuf::MessageExts
|
139
166
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
140
167
|
|
168
|
+
# Specifies the image query input.
|
169
|
+
# @!attribute [rw] image_bytes
|
170
|
+
# @return [::String]
|
171
|
+
# Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
|
172
|
+
# BMP.
|
173
|
+
class ImageQuery
|
174
|
+
include ::Google::Protobuf::MessageExts
|
175
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
176
|
+
end
|
177
|
+
|
178
|
+
# A facet specification to perform faceted search.
|
179
|
+
# @!attribute [rw] facet_key
|
180
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey]
|
181
|
+
# Required. The facet key specification.
|
182
|
+
# @!attribute [rw] limit
|
183
|
+
# @return [::Integer]
|
184
|
+
# Maximum of facet values that should be returned for this facet. If
|
185
|
+
# unspecified, defaults to 20. The maximum allowed value is 300. Values
|
186
|
+
# above 300 are coerced to 300.
|
187
|
+
#
|
188
|
+
# If this field is negative, an `INVALID_ARGUMENT` is returned.
|
189
|
+
# @!attribute [rw] excluded_filter_keys
|
190
|
+
# @return [::Array<::String>]
|
191
|
+
# List of keys to exclude when faceting.
|
192
|
+
#
|
193
|
+
#
|
194
|
+
# By default,
|
195
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
|
196
|
+
# is not excluded from the filter unless it is listed in this field.
|
197
|
+
#
|
198
|
+
# Listing a facet key in this field allows its values to appear as facet
|
199
|
+
# results, even when they are filtered out of search results. Using this
|
200
|
+
# field does not affect what search results are returned.
|
201
|
+
#
|
202
|
+
# For example, suppose there are 100 documents with the color facet "Red"
|
203
|
+
# and 200 documents with the color facet "Blue". A query containing the
|
204
|
+
# filter "color:ANY("Red")" and having "color" as
|
205
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
|
206
|
+
# would by default return only "Red" documents in the search results, and
|
207
|
+
# also return "Red" with count 100 as the only color facet. Although there
|
208
|
+
# are also blue documents available, "Blue" would not be shown as an
|
209
|
+
# available facet value.
|
210
|
+
#
|
211
|
+
# If "color" is listed in "excludedFilterKeys", then the query returns the
|
212
|
+
# facet values "Red" with count 100 and "Blue" with count 200, because the
|
213
|
+
# "color" key is now excluded from the filter. Because this field doesn't
|
214
|
+
# affect search results, the search results are still correctly filtered to
|
215
|
+
# return only "Red" documents.
|
216
|
+
#
|
217
|
+
# A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
|
218
|
+
# error is returned.
|
219
|
+
# @!attribute [rw] enable_dynamic_position
|
220
|
+
# @return [::Boolean]
|
221
|
+
# Enables dynamic position for this facet. If set to true, the position of
|
222
|
+
# this facet among all facets in the response is determined automatically.
|
223
|
+
# If dynamic facets are enabled, it is ordered together.
|
224
|
+
# If set to false, the position of this facet in the
|
225
|
+
# response is the same as in the request, and it is ranked before
|
226
|
+
# the facets with dynamic position enable and all dynamic facets.
|
227
|
+
#
|
228
|
+
# For example, you may always want to have rating facet returned in
|
229
|
+
# the response, but it's not necessarily to always display the rating facet
|
230
|
+
# at the top. In that case, you can set enable_dynamic_position to true so
|
231
|
+
# that the position of rating facet in response is determined
|
232
|
+
# automatically.
|
233
|
+
#
|
234
|
+
# Another example, assuming you have the following facets in the request:
|
235
|
+
#
|
236
|
+
# * "rating", enable_dynamic_position = true
|
237
|
+
#
|
238
|
+
# * "price", enable_dynamic_position = false
|
239
|
+
#
|
240
|
+
# * "brands", enable_dynamic_position = false
|
241
|
+
#
|
242
|
+
# And also you have a dynamic facets enabled, which generates a facet
|
243
|
+
# `gender`. Then the final order of the facets in the response can be
|
244
|
+
# ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
|
245
|
+
# "rating") depends on how API orders "gender" and "rating" facets.
|
246
|
+
# However, notice that "price" and "brands" are always
|
247
|
+
# ranked at first and second position because their enable_dynamic_position
|
248
|
+
# is false.
|
249
|
+
class FacetSpec
|
250
|
+
include ::Google::Protobuf::MessageExts
|
251
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
252
|
+
|
253
|
+
# Specifies how a facet is computed.
|
254
|
+
# @!attribute [rw] key
|
255
|
+
# @return [::String]
|
256
|
+
# Required. Supported textual and numerical facet keys in
|
257
|
+
# {::Google::Cloud::DiscoveryEngine::V1::Document Document} object, over which
|
258
|
+
# the facet values are computed. Facet key is case-sensitive.
|
259
|
+
# @!attribute [rw] intervals
|
260
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Interval>]
|
261
|
+
# Set only if values should be bucketed into intervals. Must be set
|
262
|
+
# for facets with numerical values. Must not be set for facet with text
|
263
|
+
# values. Maximum number of intervals is 30.
|
264
|
+
# @!attribute [rw] restricted_values
|
265
|
+
# @return [::Array<::String>]
|
266
|
+
# Only get facet for the given restricted values. Only supported on
|
267
|
+
# textual fields. For example, suppose "category" has three values
|
268
|
+
# "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
|
269
|
+
# "restricted_values" to "Action > 2022", the "category" facet only
|
270
|
+
# contains "Action > 2022". Only supported on textual fields. Maximum
|
271
|
+
# is 10.
|
272
|
+
# @!attribute [rw] prefixes
|
273
|
+
# @return [::Array<::String>]
|
274
|
+
# Only get facet values that start with the given string prefix. For
|
275
|
+
# example, suppose "category" has three values "Action > 2022",
|
276
|
+
# "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
|
277
|
+
# "category" facet only contains "Action > 2022" and "Action > 2021".
|
278
|
+
# Only supported on textual fields. Maximum is 10.
|
279
|
+
# @!attribute [rw] contains
|
280
|
+
# @return [::Array<::String>]
|
281
|
+
# Only get facet values that contains the given strings. For example,
|
282
|
+
# suppose "category" has three values "Action > 2022",
|
283
|
+
# "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
|
284
|
+
# "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
|
285
|
+
# Only supported on textual fields. Maximum is 10.
|
286
|
+
# @!attribute [rw] case_insensitive
|
287
|
+
# @return [::Boolean]
|
288
|
+
# True to make facet keys case insensitive when getting faceting
|
289
|
+
# values with prefixes or contains; false otherwise.
|
290
|
+
# @!attribute [rw] order_by
|
291
|
+
# @return [::String]
|
292
|
+
# The order in which documents are returned.
|
293
|
+
#
|
294
|
+
# Allowed values are:
|
295
|
+
#
|
296
|
+
# * "count desc", which means order by
|
297
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
|
298
|
+
# descending.
|
299
|
+
#
|
300
|
+
# * "value desc", which means order by
|
301
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
|
302
|
+
# descending.
|
303
|
+
# Only applies to textual facets.
|
304
|
+
#
|
305
|
+
# If not set, textual values are sorted in [natural
|
306
|
+
# order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
|
307
|
+
# intervals are sorted in the order given by
|
308
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
|
309
|
+
class FacetKey
|
310
|
+
include ::Google::Protobuf::MessageExts
|
311
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
312
|
+
end
|
313
|
+
end
|
314
|
+
|
315
|
+
# Boost specification to boost certain documents.
|
316
|
+
# @!attribute [rw] condition_boost_specs
|
317
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec::ConditionBoostSpec>]
|
318
|
+
# Condition boost specifications. If a document matches multiple conditions
|
319
|
+
# in the specifictions, boost scores from these specifications are all
|
320
|
+
# applied and combined in a non-linear way. Maximum number of
|
321
|
+
# specifications is 20.
|
322
|
+
class BoostSpec
|
323
|
+
include ::Google::Protobuf::MessageExts
|
324
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
325
|
+
|
326
|
+
# Boost applies to documents which match a condition.
|
327
|
+
# @!attribute [rw] condition
|
328
|
+
# @return [::String]
|
329
|
+
# An expression which specifies a boost condition. The syntax and
|
330
|
+
# supported fields are the same as a filter expression. See
|
331
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}
|
332
|
+
# for detail syntax and limitations.
|
333
|
+
#
|
334
|
+
# Examples:
|
335
|
+
#
|
336
|
+
# * To boost documents with document ID "doc_1" or "doc_2", and
|
337
|
+
# color
|
338
|
+
# "Red" or "Blue":
|
339
|
+
# * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
|
340
|
+
# @!attribute [rw] boost
|
341
|
+
# @return [::Float]
|
342
|
+
# Strength of the condition boost, which should be in [-1, 1]. Negative
|
343
|
+
# boost means demotion. Default is 0.0.
|
344
|
+
#
|
345
|
+
# Setting to 1.0 gives the document a big promotion. However, it does not
|
346
|
+
# necessarily mean that the boosted document will be the top result at
|
347
|
+
# all times, nor that other documents will be excluded. Results could
|
348
|
+
# still be shown even when none of them matches the condition. And
|
349
|
+
# results that are significantly more relevant to the search query can
|
350
|
+
# still trump your heavily favored but irrelevant documents.
|
351
|
+
#
|
352
|
+
# Setting to -1.0 gives the document a big demotion. However, results
|
353
|
+
# that are deeply relevant might still be shown. The document will have
|
354
|
+
# an upstream battle to get a fairly high ranking, but it is not blocked
|
355
|
+
# out completely.
|
356
|
+
#
|
357
|
+
# Setting to 0.0 means no boost applied. The boosting condition is
|
358
|
+
# ignored.
|
359
|
+
class ConditionBoostSpec
|
360
|
+
include ::Google::Protobuf::MessageExts
|
361
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
362
|
+
end
|
363
|
+
end
|
364
|
+
|
141
365
|
# Specification to determine under which conditions query expansion should
|
142
366
|
# occur.
|
143
367
|
# @!attribute [rw] condition
|
144
368
|
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec::Condition]
|
145
369
|
# The condition under which query expansion should occur. Default to
|
146
370
|
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
|
371
|
+
# @!attribute [rw] pin_unexpanded_results
|
372
|
+
# @return [::Boolean]
|
373
|
+
# Whether to pin unexpanded results. If this field is set to true,
|
374
|
+
# unexpanded products are always at the top of the search results, followed
|
375
|
+
# by the expanded results.
|
147
376
|
class QueryExpansionSpec
|
148
377
|
include ::Google::Protobuf::MessageExts
|
149
378
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -194,31 +423,100 @@ module Google
|
|
194
423
|
end
|
195
424
|
end
|
196
425
|
|
197
|
-
#
|
198
|
-
# search.
|
426
|
+
# A specification for configuring the behavior of content search.
|
199
427
|
# @!attribute [rw] snippet_spec
|
200
428
|
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SnippetSpec]
|
201
|
-
# If
|
202
|
-
# search
|
429
|
+
# If `snippetSpec` is not specified, snippets are not included in the
|
430
|
+
# search response.
|
431
|
+
# @!attribute [rw] summary_spec
|
432
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec]
|
433
|
+
# If `summarySpec` is not specified, summaries are not included in the
|
434
|
+
# search response.
|
203
435
|
class ContentSearchSpec
|
204
436
|
include ::Google::Protobuf::MessageExts
|
205
437
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
206
438
|
|
207
|
-
#
|
439
|
+
# A specification for configuring snippets in a search response.
|
208
440
|
# @!attribute [rw] max_snippet_count
|
209
441
|
# @return [::Integer]
|
210
|
-
#
|
211
|
-
#
|
212
|
-
#
|
213
|
-
#
|
214
|
-
# At most 5 snippets will be returned for each SearchResult.
|
442
|
+
# [DEPRECATED] This field is deprecated. To control snippet return, use
|
443
|
+
# `return_snippet` field. For backwards compatibility, we will return
|
444
|
+
# snippet if max_snippet_count > 0.
|
215
445
|
# @!attribute [rw] reference_only
|
216
446
|
# @return [::Boolean]
|
217
|
-
#
|
447
|
+
# [DEPRECATED] This field is deprecated and will have no affect on the
|
448
|
+
# snippet.
|
449
|
+
# @!attribute [rw] return_snippet
|
450
|
+
# @return [::Boolean]
|
451
|
+
# If `true`, then return snippet. If no snippet can be generated, we
|
452
|
+
# return "No snippet is available for this page." A `snippet_status` with
|
453
|
+
# `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
|
218
454
|
class SnippetSpec
|
219
455
|
include ::Google::Protobuf::MessageExts
|
220
456
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
221
457
|
end
|
458
|
+
|
459
|
+
# A specification for configuring a summary returned in a search
|
460
|
+
# response.
|
461
|
+
# @!attribute [rw] summary_result_count
|
462
|
+
# @return [::Integer]
|
463
|
+
# The number of top results to generate the summary from. If the number
|
464
|
+
# of results returned is less than `summaryResultCount`, the summary is
|
465
|
+
# generated from all of the results.
|
466
|
+
#
|
467
|
+
# At most five results can be used to generate a summary.
|
468
|
+
# @!attribute [rw] include_citations
|
469
|
+
# @return [::Boolean]
|
470
|
+
# Specifies whether to include citations in the summary. The default
|
471
|
+
# value is `false`.
|
472
|
+
#
|
473
|
+
# When this field is set to `true`, summaries include in-line citation
|
474
|
+
# numbers.
|
475
|
+
#
|
476
|
+
# Example summary including citations:
|
477
|
+
#
|
478
|
+
# BigQuery is Google Cloud's fully managed and completely serverless
|
479
|
+
# enterprise data warehouse [1]. BigQuery supports all data types, works
|
480
|
+
# across clouds, and has built-in machine learning and business
|
481
|
+
# intelligence, all within a unified platform [2, 3].
|
482
|
+
#
|
483
|
+
# The citation numbers refer to the returned search results and are
|
484
|
+
# 1-indexed. For example, [1] means that the sentence is attributed to
|
485
|
+
# the first search result. [2, 3] means that the sentence is attributed
|
486
|
+
# to both the second and third search results.
|
487
|
+
# @!attribute [rw] ignore_adversarial_query
|
488
|
+
# @return [::Boolean]
|
489
|
+
# Specifies whether to filter out adversarial queries. The default value
|
490
|
+
# is `false`.
|
491
|
+
#
|
492
|
+
# Google employs search-query classification to detect adversarial
|
493
|
+
# queries. No summary is returned if the search query is classified as an
|
494
|
+
# adversarial query. For example, a user might ask a question regarding
|
495
|
+
# negative comments about the company or submit a query designed to
|
496
|
+
# generate unsafe, policy-violating output. If this field is set to
|
497
|
+
# `true`, we skip generating summaries for adversarial queries and return
|
498
|
+
# fallback messages instead.
|
499
|
+
# @!attribute [rw] ignore_non_summary_seeking_query
|
500
|
+
# @return [::Boolean]
|
501
|
+
# Specifies whether to filter out queries that are not summary-seeking.
|
502
|
+
# The default value is `false`.
|
503
|
+
#
|
504
|
+
# Google employs search-query classification to detect summary-seeking
|
505
|
+
# queries. No summary is returned if the search query is classified as a
|
506
|
+
# non-summary seeking query. For example, `why is the sky blue` and `Who
|
507
|
+
# is the best soccer player in the world?` are summary-seeking queries,
|
508
|
+
# but `SFO airport` and `world cup 2026` are not. They are most likely
|
509
|
+
# navigational queries. If this field is set to `true`, we skip
|
510
|
+
# generating summaries for non-summary seeking queries and return
|
511
|
+
# fallback messages instead.
|
512
|
+
# @!attribute [rw] language_code
|
513
|
+
# @return [::String]
|
514
|
+
# Language code for Summary. Use language tags defined by
|
515
|
+
# [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
|
516
|
+
class SummarySpec
|
517
|
+
include ::Google::Protobuf::MessageExts
|
518
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
519
|
+
end
|
222
520
|
end
|
223
521
|
|
224
522
|
# @!attribute [rw] key
|
@@ -246,6 +544,9 @@ module Google
|
|
246
544
|
# @!attribute [rw] results
|
247
545
|
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>]
|
248
546
|
# A list of matched documents. The order represents the ranking.
|
547
|
+
# @!attribute [rw] facets
|
548
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet>]
|
549
|
+
# Results of facets requested by user.
|
249
550
|
# @!attribute [rw] total_size
|
250
551
|
# @return [::Integer]
|
251
552
|
# The estimated total count of matched items irrespective of pagination. The
|
@@ -259,6 +560,14 @@ module Google
|
|
259
560
|
# {::Google::Cloud::DiscoveryEngine::V1::UserEvent UserEvent} logs resulting from
|
260
561
|
# this search, which enables accurate attribution of search model
|
261
562
|
# performance.
|
563
|
+
# @!attribute [rw] redirect_uri
|
564
|
+
# @return [::String]
|
565
|
+
# The URI of a customer-defined redirect page. If redirect action is
|
566
|
+
# triggered, no search is performed, and only
|
567
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#redirect_uri redirect_uri}
|
568
|
+
# and
|
569
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#attribution_token attribution_token}
|
570
|
+
# are set in the response.
|
262
571
|
# @!attribute [rw] next_page_token
|
263
572
|
# @return [::String]
|
264
573
|
# A token that can be sent as
|
@@ -270,6 +579,15 @@ module Google
|
|
270
579
|
# Contains the spell corrected query, if found. If the spell correction type
|
271
580
|
# is AUTOMATIC, then the search results are based on corrected_query.
|
272
581
|
# Otherwise the original query is used for search.
|
582
|
+
# @!attribute [rw] summary
|
583
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary]
|
584
|
+
# A summary as part of the search results.
|
585
|
+
# This field is only returned if
|
586
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#summary_spec SearchRequest.ContentSearchSpec.summary_spec}
|
587
|
+
# is set.
|
588
|
+
# @!attribute [rw] query_expansion_info
|
589
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::QueryExpansionInfo]
|
590
|
+
# Query expansion information for the returned results.
|
273
591
|
class SearchResponse
|
274
592
|
include ::Google::Protobuf::MessageExts
|
275
593
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -287,6 +605,124 @@ module Google
|
|
287
605
|
include ::Google::Protobuf::MessageExts
|
288
606
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
289
607
|
end
|
608
|
+
|
609
|
+
# A facet result.
|
610
|
+
# @!attribute [rw] key
|
611
|
+
# @return [::String]
|
612
|
+
# The key for this facet. E.g., "colors" or "price". It matches
|
613
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
|
614
|
+
# @!attribute [rw] values
|
615
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
|
616
|
+
# The facet values for this field.
|
617
|
+
# @!attribute [rw] dynamic_facet
|
618
|
+
# @return [::Boolean]
|
619
|
+
# Whether the facet is dynamically generated.
|
620
|
+
class Facet
|
621
|
+
include ::Google::Protobuf::MessageExts
|
622
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
623
|
+
|
624
|
+
# A facet value which contains value names and their count.
|
625
|
+
# @!attribute [rw] value
|
626
|
+
# @return [::String]
|
627
|
+
# Text value of a facet, such as "Black" for facet "colors".
|
628
|
+
# @!attribute [rw] interval
|
629
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
|
630
|
+
# Interval value for a facet, such as [10, 20) for facet "price". It
|
631
|
+
# matches
|
632
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
|
633
|
+
# @!attribute [rw] count
|
634
|
+
# @return [::Integer]
|
635
|
+
# Number of items that have this facet value.
|
636
|
+
class FacetValue
|
637
|
+
include ::Google::Protobuf::MessageExts
|
638
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
639
|
+
end
|
640
|
+
end
|
641
|
+
|
642
|
+
# Summary of the top N search result specified by the summary spec.
|
643
|
+
# @!attribute [rw] summary_text
|
644
|
+
# @return [::String]
|
645
|
+
# The summary content.
|
646
|
+
# @!attribute [rw] summary_skipped_reasons
|
647
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummarySkippedReason>]
|
648
|
+
# Additional summary-skipped reasons. This provides the reason for ignored
|
649
|
+
# cases. If nothing is skipped, this field is not set.
|
650
|
+
# @!attribute [rw] safety_attributes
|
651
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SafetyAttributes]
|
652
|
+
# A collection of Safety Attribute categories and their associated
|
653
|
+
# confidence scores.
|
654
|
+
class Summary
|
655
|
+
include ::Google::Protobuf::MessageExts
|
656
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
657
|
+
|
658
|
+
# Safety Attribute categories and their associated confidence scores.
|
659
|
+
# @!attribute [rw] categories
|
660
|
+
# @return [::Array<::String>]
|
661
|
+
# The display names of Safety Attribute categories associated with the
|
662
|
+
# generated content. Order matches the Scores.
|
663
|
+
# @!attribute [rw] scores
|
664
|
+
# @return [::Array<::Float>]
|
665
|
+
# The confidence scores of the each category, higher
|
666
|
+
# value means higher confidence. Order matches the Categories.
|
667
|
+
class SafetyAttributes
|
668
|
+
include ::Google::Protobuf::MessageExts
|
669
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
670
|
+
end
|
671
|
+
|
672
|
+
# An Enum for summary-skipped reasons.
|
673
|
+
module SummarySkippedReason
|
674
|
+
# Default value. The summary skipped reason is not specified.
|
675
|
+
SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0
|
676
|
+
|
677
|
+
# The adversarial query ignored case.
|
678
|
+
#
|
679
|
+
# Only populated when
|
680
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query}
|
681
|
+
# is set to `true`.
|
682
|
+
ADVERSARIAL_QUERY_IGNORED = 1
|
683
|
+
|
684
|
+
# The non-summary seeking query ignored case.
|
685
|
+
#
|
686
|
+
# Only populated when
|
687
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query SummarySpec.ignore_non_summary_seeking_query}
|
688
|
+
# is set to `true`.
|
689
|
+
NON_SUMMARY_SEEKING_QUERY_IGNORED = 2
|
690
|
+
|
691
|
+
# The out-of-domain query ignored case.
|
692
|
+
#
|
693
|
+
# Google skips the summary if there are no high-relevance search results.
|
694
|
+
# For example, the data store contains facts about company A but the
|
695
|
+
# user query is asking questions about company B.
|
696
|
+
OUT_OF_DOMAIN_QUERY_IGNORED = 3
|
697
|
+
|
698
|
+
# The potential policy violation case.
|
699
|
+
#
|
700
|
+
# Google skips the summary if there is a potential policy violation
|
701
|
+
# detected. This includes content that may be violent or toxic.
|
702
|
+
POTENTIAL_POLICY_VIOLATION = 4
|
703
|
+
|
704
|
+
# The LLM addon not enabled case.
|
705
|
+
#
|
706
|
+
# Google skips the summary if the LLM addon is not enabled.
|
707
|
+
LLM_ADDON_NOT_ENABLED = 5
|
708
|
+
end
|
709
|
+
end
|
710
|
+
|
711
|
+
# Information describing query expansion including whether expansion has
|
712
|
+
# occurred.
|
713
|
+
# @!attribute [rw] expanded_query
|
714
|
+
# @return [::Boolean]
|
715
|
+
# Bool describing whether query expansion has occurred.
|
716
|
+
# @!attribute [rw] pinned_result_count
|
717
|
+
# @return [::Integer]
|
718
|
+
# Number of pinned results. This field will only be set when expansion
|
719
|
+
# happens and
|
720
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
|
721
|
+
# is set to true.
|
722
|
+
class QueryExpansionInfo
|
723
|
+
include ::Google::Protobuf::MessageExts
|
724
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
725
|
+
end
|
290
726
|
end
|
291
727
|
end
|
292
728
|
end
|