google-cloud-discovery_engine-v1beta 0.3.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +21 -3
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +21 -3
  5. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +959 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/credentials.rb +47 -0
  7. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/paths.rb +176 -0
  8. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +797 -0
  9. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +450 -0
  10. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest.rb +52 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service.rb +55 -0
  12. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +19 -4
  13. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +19 -4
  14. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +42 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +14 -0
  16. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +14 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +2 -1
  18. data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +14 -0
  19. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +14 -0
  20. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +42 -0
  21. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +57 -12
  22. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +57 -12
  23. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +16 -2
  24. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +16 -2
  25. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +42 -0
  26. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  27. data/lib/google/cloud/discovery_engine/v1beta.rb +2 -1
  28. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +2 -1
  29. data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +1 -1
  30. data/lib/google/cloud/discoveryengine/v1beta/conversation_pb.rb +55 -0
  31. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +61 -0
  32. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_services_pb.rb +67 -0
  33. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +7 -1
  34. data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +1 -1
  35. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +1 -1
  36. data/proto_docs/google/api/field_behavior.rb +14 -0
  37. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +10 -2
  38. data/proto_docs/google/cloud/discoveryengine/v1beta/completion_service.rb +13 -2
  39. data/proto_docs/google/cloud/discoveryengine/v1beta/conversation.rb +138 -0
  40. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +209 -0
  41. data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +2 -4
  42. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +2 -1
  43. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +17 -17
  44. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +295 -61
  45. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +41 -29
  46. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event_service.rb +1 -1
  47. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  48. 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::V1beta::SearchRequest::ImageQuery]
45
+ # Raw image query.
43
46
  # @!attribute [rw] page_size
44
47
  # @return [::Integer]
45
48
  # Maximum number of {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s
46
49
  # to return. If unspecified, defaults to a reasonable value. The maximum
47
- # allowed value is 100. Values above 100 will be coerced to 100.
50
+ # allowed 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
@@ -76,17 +79,18 @@ module Google
76
79
  # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
77
80
  # @!attribute [rw] order_by
78
81
  # @return [::String]
79
- # The order in which documents are returned. Document can be ordered by
82
+ # The order in which documents are returned. Documents can be ordered by
80
83
  # a field in an {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}
81
- # object. Leave it unset if ordered by relevance. OrderBy expression is
84
+ # object. Leave it unset if ordered by relevance. `order_by` expression is
82
85
  # case-sensitive.
83
86
  #
84
- # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
87
+ # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
85
88
  # @!attribute [rw] user_info
86
89
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::UserInfo]
87
90
  # Information about the end user.
88
- # Highly recommended for analytics. The user_agent string in UserInfo will
89
- # be used to deduce device_type for analytics.
91
+ # Highly recommended for analytics.
92
+ # {::Google::Cloud::DiscoveryEngine::V1beta::UserInfo#user_agent UserInfo.user_agent}
93
+ # is used to deduce `device_type` for analytics.
90
94
  # @!attribute [rw] facet_specs
91
95
  # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec>]
92
96
  # Facet specifications for faceted search. If empty, no facets are returned.
@@ -110,11 +114,11 @@ module Google
110
114
  # @!attribute [rw] query_expansion_spec
111
115
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec]
112
116
  # The query expansion specification that specifies the conditions under which
113
- # query expansion will occur.
117
+ # query expansion occurs.
114
118
  # @!attribute [rw] spell_correction_spec
115
119
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec]
116
120
  # The spell correction specification that specifies the mode under
117
- # which spell correction will take effect.
121
+ # which spell correction takes effect.
118
122
  # @!attribute [rw] user_pseudo_id
119
123
  # @return [::String]
120
124
  # A unique identifier for tracking visitors. For example, this could be
@@ -133,12 +137,42 @@ module Google
133
137
  # characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
134
138
  # @!attribute [rw] content_search_spec
135
139
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec]
136
- # The content search spec that configs the desired behavior of content
137
- # search.
140
+ # A specification for configuring the behavior of content search.
141
+ # @!attribute [rw] embedding_spec
142
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec]
143
+ # Uses the provided embedding to do additional semantic document retrieval.
144
+ # The retrieval is based on the dot product of
145
+ # [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
146
+ # embedding that is provided in
147
+ # [SearchRequest.embedding_spec.embedding_vectors.field_path][].
148
+ #
149
+ # If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
150
+ # provided, it will use [ServingConfig.embedding_config.field_paths][].
151
+ # @!attribute [rw] ranking_expression
152
+ # @return [::String]
153
+ # The ranking expression controls the customized ranking on retrieval
154
+ # documents. This overrides [ServingConfig.ranking_expression][].
155
+ # The ranking expression is a single function or multiple functions that are
156
+ # joint by "+".
157
+ # * ranking_expression = function, { " + ", function };
158
+ # Supported functions:
159
+ # * double * relevance_score
160
+ # * double * dotProduct(embedding_field_path)
161
+ # Function variables:
162
+ # `relevance_score`: pre-defined keywords, used for measure relevance
163
+ # between query and document.
164
+ # `embedding_field_path`: the document embedding field
165
+ # used with query embedding vector.
166
+ # `dotProduct`: embedding function between embedding_field_path and query
167
+ # embedding vector.
168
+ #
169
+ # Example ranking expression:
170
+ # If document has an embedding field doc_embedding, the ranking expression
171
+ # could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
138
172
  # @!attribute [rw] safe_search
139
173
  # @return [::Boolean]
140
174
  # Whether to turn on safe search. This is only supported for
141
- # [ContentConfig.PUBLIC_WEBSITE][].
175
+ # website search.
142
176
  # @!attribute [rw] user_labels
143
177
  # @return [::Google::Protobuf::Map{::String => ::String}]
144
178
  # The user labels applied to a resource must meet the following requirements:
@@ -162,6 +196,16 @@ module Google
162
196
  include ::Google::Protobuf::MessageExts
163
197
  extend ::Google::Protobuf::MessageExts::ClassMethods
164
198
 
199
+ # Specifies the image query input.
200
+ # @!attribute [rw] image_bytes
201
+ # @return [::String]
202
+ # Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
203
+ # BMP.
204
+ class ImageQuery
205
+ include ::Google::Protobuf::MessageExts
206
+ extend ::Google::Protobuf::MessageExts::ClassMethods
207
+ end
208
+
165
209
  # A facet specification to perform faceted search.
166
210
  # @!attribute [rw] facet_key
167
211
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
@@ -170,7 +214,7 @@ module Google
170
214
  # @return [::Integer]
171
215
  # Maximum of facet values that should be returned for this facet. If
172
216
  # unspecified, defaults to 20. The maximum allowed value is 300. Values
173
- # above 300 will be coerced to 300.
217
+ # above 300 are coerced to 300.
174
218
  #
175
219
  # If this field is negative, an `INVALID_ARGUMENT` is returned.
176
220
  # @!attribute [rw] excluded_filter_keys
@@ -207,15 +251,15 @@ module Google
207
251
  # @return [::Boolean]
208
252
  # Enables dynamic position for this facet. If set to true, the position of
209
253
  # this facet among all facets in the response is determined automatically.
210
- # It will be ordered together with dynamic facets if dynamic
211
- # facets is enabled. If set to false, the position of this facet in the
212
- # response will be the same as in the request, and it will be ranked before
254
+ # If dynamic facets are enabled, it is ordered together.
255
+ # If set to false, the position of this facet in the
256
+ # response is the same as in the request, and it is ranked before
213
257
  # the facets with dynamic position enable and all dynamic facets.
214
258
  #
215
259
  # For example, you may always want to have rating facet returned in
216
260
  # the response, but it's not necessarily to always display the rating facet
217
261
  # at the top. In that case, you can set enable_dynamic_position to true so
218
- # that the position of rating facet in response will be determined
262
+ # that the position of rating facet in response is determined
219
263
  # automatically.
220
264
  #
221
265
  # Another example, assuming you have the following facets in the request:
@@ -226,13 +270,13 @@ module Google
226
270
  #
227
271
  # * "brands", enable_dynamic_position = false
228
272
  #
229
- # And also you have a dynamic facets enable, which will generate a facet
230
- # 'gender'. Then the final order of the facets in the response can be
273
+ # And also you have a dynamic facets enabled, which generates a facet
274
+ # `gender`. Then the final order of the facets in the response can be
231
275
  # ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
232
276
  # "rating") depends on how API orders "gender" and "rating" facets.
233
- # However, notice that "price" and "brands" will always be
234
- # ranked at 1st and 2nd position since their enable_dynamic_position are
235
- # false.
277
+ # However, notice that "price" and "brands" are always
278
+ # ranked at first and second position because their enable_dynamic_position
279
+ # is false.
236
280
  class FacetSpec
237
281
  include ::Google::Protobuf::MessageExts
238
282
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -245,7 +289,7 @@ module Google
245
289
  # which the facet values are computed. Facet key is case-sensitive.
246
290
  # @!attribute [rw] intervals
247
291
  # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
248
- # Set only if values should be bucketized into intervals. Must be set
292
+ # Set only if values should be bucketed into intervals. Must be set
249
293
  # for facets with numerical values. Must not be set for facet with text
250
294
  # values. Maximum number of intervals is 30.
251
295
  # @!attribute [rw] restricted_values
@@ -253,22 +297,22 @@ module Google
253
297
  # Only get facet for the given restricted values. Only supported on
254
298
  # textual fields. For example, suppose "category" has three values
255
299
  # "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
256
- # "restricted_values" to "Action > 2022", the "category" facet will only
257
- # contain "Action > 2022". Only supported on textual fields. Maximum
300
+ # "restricted_values" to "Action > 2022", the "category" facet only
301
+ # contains "Action > 2022". Only supported on textual fields. Maximum
258
302
  # is 10.
259
303
  # @!attribute [rw] prefixes
260
304
  # @return [::Array<::String>]
261
305
  # Only get facet values that start with the given string prefix. For
262
306
  # example, suppose "category" has three values "Action > 2022",
263
307
  # "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
264
- # "category" facet will only contain "Action > 2022" and "Action > 2021".
308
+ # "category" facet only contains "Action > 2022" and "Action > 2021".
265
309
  # Only supported on textual fields. Maximum is 10.
266
310
  # @!attribute [rw] contains
267
311
  # @return [::Array<::String>]
268
312
  # Only get facet values that contains the given strings. For example,
269
313
  # suppose "category" has three values "Action > 2022",
270
314
  # "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
271
- # "category" facet will only contain "Action > 2022" and "Sci-Fi > 2022".
315
+ # "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
272
316
  # Only supported on textual fields. Maximum is 10.
273
317
  # @!attribute [rw] case_insensitive
274
318
  # @return [::Boolean]
@@ -355,6 +399,11 @@ module Google
355
399
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
356
400
  # The condition under which query expansion should occur. Default to
357
401
  # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
402
+ # @!attribute [rw] pin_unexpanded_results
403
+ # @return [::Boolean]
404
+ # Whether to pin unexpanded results. If this field is set to true,
405
+ # unexpanded products are always at the top of the search results, followed
406
+ # by the expanded results.
358
407
  class QueryExpansionSpec
359
408
  include ::Google::Protobuf::MessageExts
360
409
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -405,15 +454,14 @@ module Google
405
454
  end
406
455
  end
407
456
 
408
- # The specification that configs the desired behavior of the UCS content
409
- # search.
457
+ # A specification for configuring the behavior of content search.
410
458
  # @!attribute [rw] snippet_spec
411
459
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
412
- # If there is no snippet spec provided, there will be no snippet in the
413
- # search result.
460
+ # If `snippetSpec` is not specified, snippets are not included in the
461
+ # search response.
414
462
  # @!attribute [rw] summary_spec
415
463
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
416
- # If there is no summary spec provided, there will be no summary in the
464
+ # If `summarySpec` is not specified, summaries are not included in the
417
465
  # search response.
418
466
  # @!attribute [rw] extractive_content_spec
419
467
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
@@ -423,74 +471,166 @@ module Google
423
471
  include ::Google::Protobuf::MessageExts
424
472
  extend ::Google::Protobuf::MessageExts::ClassMethods
425
473
 
426
- # The specification that configs the snippet in the search results.
474
+ # A specification for configuring snippets in a search response.
427
475
  # @!attribute [rw] max_snippet_count
428
476
  # @return [::Integer]
429
- # Max number of snippets returned in each search result.
430
- #
431
- # A snippet is an infomartive summary of a content with highlighting for
432
- # UI rendering.
433
- #
434
- # If the matching snippets is less than the max_snippet_count, return all
435
- # of the snippets; otherwise, return the max_snippet_count.
436
- #
437
- # At most 5 snippets will be returned for each SearchResult.
477
+ # [DEPRECATED] This field is deprecated. To control snippet return, use
478
+ # `return_snippet` field. For backwards compatibility, we will return
479
+ # snippet if max_snippet_count > 0.
438
480
  # @!attribute [rw] reference_only
439
481
  # @return [::Boolean]
440
- # if true, only snippet reference is returned.
482
+ # [DEPRECATED] This field is deprecated and will have no affect on the
483
+ # snippet.
484
+ # @!attribute [rw] return_snippet
485
+ # @return [::Boolean]
486
+ # If `true`, then return snippet. If no snippet can be generated, we
487
+ # return "No snippet is available for this page." A `snippet_status` with
488
+ # `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
441
489
  class SnippetSpec
442
490
  include ::Google::Protobuf::MessageExts
443
491
  extend ::Google::Protobuf::MessageExts::ClassMethods
444
492
  end
445
493
 
446
- # The specification that configs the summary in the search response.
494
+ # A specification for configuring a summary returned in a search
495
+ # response.
447
496
  # @!attribute [rw] summary_result_count
448
497
  # @return [::Integer]
449
- # The number of top results the summary should be generated from.
450
- # If the number of returned results is less than summary_result_count,
451
- # then the summary would be derived from all the results; otherwise, the
452
- # summary would be derived from the top results.
498
+ # The number of top results to generate the summary from. If the number
499
+ # of results returned is less than `summaryResultCount`, the summary is
500
+ # generated from all of the results.
501
+ #
502
+ # At most five results can be used to generate a summary.
503
+ # @!attribute [rw] include_citations
504
+ # @return [::Boolean]
505
+ # Specifies whether to include citations in the summary. The default
506
+ # value is `false`.
507
+ #
508
+ # When this field is set to `true`, summaries include in-line citation
509
+ # numbers.
510
+ #
511
+ # Example summary including citations:
512
+ #
513
+ # BigQuery is Google Cloud's fully managed and completely serverless
514
+ # enterprise data warehouse [1]. BigQuery supports all data types, works
515
+ # across clouds, and has built-in machine learning and business
516
+ # intelligence, all within a unified platform [2, 3].
517
+ #
518
+ # The citation numbers refer to the returned search results and are
519
+ # 1-indexed. For example, [1] means that the sentence is attributed to
520
+ # the first search result. [2, 3] means that the sentence is attributed
521
+ # to both the second and third search results.
522
+ # @!attribute [rw] ignore_adversarial_query
523
+ # @return [::Boolean]
524
+ # Specifies whether to filter out adversarial queries. The default value
525
+ # is `false`.
526
+ #
527
+ # Google employs search-query classification to detect adversarial
528
+ # queries. No summary is returned if the search query is classified as an
529
+ # adversarial query. For example, a user might ask a question regarding
530
+ # negative comments about the company or submit a query designed to
531
+ # generate unsafe, policy-violating output. If this field is set to
532
+ # `true`, we skip generating summaries for adversarial queries and return
533
+ # fallback messages instead.
534
+ # @!attribute [rw] ignore_non_summary_seeking_query
535
+ # @return [::Boolean]
536
+ # Specifies whether to filter out queries that are not summary-seeking.
537
+ # The default value is `false`.
453
538
  #
454
- # At most 5 results can be used for generating summary.
539
+ # Google employs search-query classification to detect summary-seeking
540
+ # queries. No summary is returned if the search query is classified as a
541
+ # non-summary seeking query. For example, `why is the sky blue` and `Who
542
+ # is the best soccer player in the world?` are summary-seeking queries,
543
+ # but `SFO airport` and `world cup 2026` are not. They are most likely
544
+ # navigational queries. If this field is set to `true`, we skip
545
+ # generating summaries for non-summary seeking queries and return
546
+ # fallback messages instead.
547
+ # @!attribute [rw] language_code
548
+ # @return [::String]
549
+ # Language code for Summary. Use language tags defined by
550
+ # [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
455
551
  class SummarySpec
456
552
  include ::Google::Protobuf::MessageExts
457
553
  extend ::Google::Protobuf::MessageExts::ClassMethods
458
554
  end
459
555
 
460
- # The specification that configs the extractive content in search results.
556
+ # A specification for configuring the extractive content in a search
557
+ # response.
461
558
  # @!attribute [rw] max_extractive_answer_count
462
559
  # @return [::Integer]
463
- # The max number of extractive answers returned in each search result.
560
+ # The maximum number of extractive answers returned in each search
561
+ # result.
464
562
  #
465
563
  # An extractive answer is a verbatim answer extracted from the original
466
- # document, which provides precise and contextually relevant answer to
564
+ # document, which provides a precise and contextually relevant answer to
467
565
  # the search query.
468
566
  #
469
567
  # If the number of matching answers is less than the
470
- # extractive_answer_count, return all of the answers; otherwise, return
471
- # the extractive_answer_count.
568
+ # `max_extractive_answer_count`, return all of the answers. Otherwise,
569
+ # return the `max_extractive_answer_count`.
472
570
  #
473
- # At most 5 answers will be returned for each SearchResult.
571
+ # At most one answer is returned for each
572
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
474
573
  # @!attribute [rw] max_extractive_segment_count
475
574
  # @return [::Integer]
476
575
  # The max number of extractive segments returned in each search result.
576
+ # Only applied if the
577
+ # [DataStore][google.cloud.discoveryengine.v1beta.DataStore] is set to
578
+ # [DataStore.ContentConfig.CONTENT_REQUIRED][google.cloud.discoveryengine.v1beta.DataStore.ContentConfig.CONTENT_REQUIRED]
579
+ # or
580
+ # [DataStore.solution_types][google.cloud.discoveryengine.v1beta.DataStore.solution_types]
581
+ # is
582
+ # [SOLUTION_TYPE_CHAT][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_CHAT].
477
583
  #
478
584
  # An extractive segment is a text segment extracted from the original
479
- # document which is relevant to the search query and in general more
480
- # verbose than an extrative answer. The segment could then be used as
585
+ # document that is relevant to the search query, and, in general, more
586
+ # verbose than an extractive answer. The segment could then be used as
481
587
  # input for LLMs to generate summaries and answers.
482
588
  #
483
- # If the number of matching segments is less than the
484
- # max_extractive_segment_count, return all of the segments; otherwise,
485
- # return the max_extractive_segment_count.
486
- #
487
- # Currently one segment will be returned for each SearchResult.
589
+ # If the number of matching segments is less than
590
+ # `max_extractive_segment_count`, return all of the segments. Otherwise,
591
+ # return the `max_extractive_segment_count`.
592
+ # @!attribute [rw] return_extractive_segment_score
593
+ # @return [::Boolean]
594
+ # Specifies whether to return the confidence score from the extractive
595
+ # segments in each search result. The default value is `false`.
596
+ # @!attribute [rw] num_previous_segments
597
+ # @return [::Integer]
598
+ # Specifies whether to also include the adjacent from each selected
599
+ # segments.
600
+ # Return at most `num_previous_segments` segments before each selected
601
+ # segments.
602
+ # @!attribute [rw] num_next_segments
603
+ # @return [::Integer]
604
+ # Return at most `num_next_segments` segments after each selected
605
+ # segments.
488
606
  class ExtractiveContentSpec
489
607
  include ::Google::Protobuf::MessageExts
490
608
  extend ::Google::Protobuf::MessageExts::ClassMethods
491
609
  end
492
610
  end
493
611
 
612
+ # The specification that uses customized query embedding vector to do
613
+ # semantic document retrieval.
614
+ # @!attribute [rw] embedding_vectors
615
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
616
+ # The embedding vector used for retrieval. Limit to 1.
617
+ class EmbeddingSpec
618
+ include ::Google::Protobuf::MessageExts
619
+ extend ::Google::Protobuf::MessageExts::ClassMethods
620
+
621
+ # Embedding vector.
622
+ # @!attribute [rw] field_path
623
+ # @return [::String]
624
+ # Embedding field path in schema.
625
+ # @!attribute [rw] vector
626
+ # @return [::Array<::Float>]
627
+ # Query embedding vector.
628
+ class EmbeddingVector
629
+ include ::Google::Protobuf::MessageExts
630
+ extend ::Google::Protobuf::MessageExts::ClassMethods
631
+ end
632
+ end
633
+
494
634
  # @!attribute [rw] key
495
635
  # @return [::String]
496
636
  # @!attribute [rw] value
@@ -564,6 +704,9 @@ module Google
564
704
  # @!attribute [rw] applied_controls
565
705
  # @return [::Array<::String>]
566
706
  # Controls applied as part of the Control service.
707
+ # @!attribute [rw] query_expansion_info
708
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::QueryExpansionInfo]
709
+ # Query expansion information for the returned results.
567
710
  class SearchResponse
568
711
  include ::Google::Protobuf::MessageExts
569
712
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -577,9 +720,21 @@ module Google
577
720
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::Document]
578
721
  # The document data snippet in the search response. Only fields that are
579
722
  # marked as retrievable are populated.
723
+ # @!attribute [rw] model_scores
724
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1beta::DoubleList}]
725
+ # Google provided available scores.
580
726
  class SearchResult
581
727
  include ::Google::Protobuf::MessageExts
582
728
  extend ::Google::Protobuf::MessageExts::ClassMethods
729
+
730
+ # @!attribute [rw] key
731
+ # @return [::String]
732
+ # @!attribute [rw] value
733
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::DoubleList]
734
+ class ModelScoresEntry
735
+ include ::Google::Protobuf::MessageExts
736
+ extend ::Google::Protobuf::MessageExts::ClassMethods
737
+ end
583
738
  end
584
739
 
585
740
  # A facet result.
@@ -620,6 +775,9 @@ module Google
620
775
  # @!attribute [rw] refinement_attributes
621
776
  # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::GuidedSearchResult::RefinementAttribute>]
622
777
  # A list of ranked refinement attributes.
778
+ # @!attribute [rw] follow_up_questions
779
+ # @return [::Array<::String>]
780
+ # Suggested follow-up questions.
623
781
  class GuidedSearchResult
624
782
  include ::Google::Protobuf::MessageExts
625
783
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -641,9 +799,85 @@ module Google
641
799
  # @!attribute [rw] summary_text
642
800
  # @return [::String]
643
801
  # The summary content.
802
+ # @!attribute [rw] summary_skipped_reasons
803
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Summary::SummarySkippedReason>]
804
+ # Additional summary-skipped reasons. This provides the reason for ignored
805
+ # cases. If nothing is skipped, this field is not set.
806
+ # @!attribute [rw] safety_attributes
807
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Summary::SafetyAttributes]
808
+ # A collection of Safety Attribute categories and their associated
809
+ # confidence scores.
644
810
  class Summary
645
811
  include ::Google::Protobuf::MessageExts
646
812
  extend ::Google::Protobuf::MessageExts::ClassMethods
813
+
814
+ # Safety Attribute categories and their associated confidence scores.
815
+ # @!attribute [rw] categories
816
+ # @return [::Array<::String>]
817
+ # The display names of Safety Attribute categories associated with the
818
+ # generated content. Order matches the Scores.
819
+ # @!attribute [rw] scores
820
+ # @return [::Array<::Float>]
821
+ # The confidence scores of the each category, higher
822
+ # value means higher confidence. Order matches the Categories.
823
+ class SafetyAttributes
824
+ include ::Google::Protobuf::MessageExts
825
+ extend ::Google::Protobuf::MessageExts::ClassMethods
826
+ end
827
+
828
+ # An Enum for summary-skipped reasons.
829
+ module SummarySkippedReason
830
+ # Default value. The summary skipped reason is not specified.
831
+ SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0
832
+
833
+ # The adversarial query ignored case.
834
+ #
835
+ # Only populated when
836
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query}
837
+ # is set to `true`.
838
+ ADVERSARIAL_QUERY_IGNORED = 1
839
+
840
+ # The non-summary seeking query ignored case.
841
+ #
842
+ # Only populated when
843
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query SummarySpec.ignore_non_summary_seeking_query}
844
+ # is set to `true`.
845
+ NON_SUMMARY_SEEKING_QUERY_IGNORED = 2
846
+
847
+ # The out-of-domain query ignored case.
848
+ #
849
+ # Google skips the summary if there are no high-relevance search results.
850
+ # For example, the data store contains facts about company A but the
851
+ # user query is asking questions about company B.
852
+ OUT_OF_DOMAIN_QUERY_IGNORED = 3
853
+
854
+ # The potential policy violation case.
855
+ #
856
+ # Google skips the summary if there is a potential policy violation
857
+ # detected. This includes content that may be violent or toxic.
858
+ POTENTIAL_POLICY_VIOLATION = 4
859
+
860
+ # The LLM addon not enabled case.
861
+ #
862
+ # Google skips the summary if the LLM addon is not enabled.
863
+ LLM_ADDON_NOT_ENABLED = 5
864
+ end
865
+ end
866
+
867
+ # Information describing query expansion including whether expansion has
868
+ # occurred.
869
+ # @!attribute [rw] expanded_query
870
+ # @return [::Boolean]
871
+ # Bool describing whether query expansion has occurred.
872
+ # @!attribute [rw] pinned_result_count
873
+ # @return [::Integer]
874
+ # Number of pinned results. This field will only be set when expansion
875
+ # happens and
876
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
877
+ # is set to true.
878
+ class QueryExpansionInfo
879
+ include ::Google::Protobuf::MessageExts
880
+ extend ::Google::Protobuf::MessageExts::ClassMethods
647
881
  end
648
882
  end
649
883
  end