google-cloud-discovery_engine-v1 0.6.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +9 -3
  3. data/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb +13 -5
  4. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +9 -3
  5. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +28 -5
  6. data/lib/google/cloud/discovery_engine/v1/control_service/client.rb +875 -0
  7. data/lib/google/cloud/discovery_engine/v1/control_service/credentials.rb +47 -0
  8. data/lib/google/cloud/discovery_engine/v1/control_service/paths.rb +167 -0
  9. data/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb +814 -0
  10. data/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb +440 -0
  11. data/lib/google/cloud/discovery_engine/v1/control_service/rest.rb +55 -0
  12. data/lib/google/cloud/discovery_engine/v1/control_service.rb +58 -0
  13. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +769 -7
  14. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb +199 -0
  15. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +720 -7
  16. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +520 -0
  17. data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +15 -7
  18. data/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb +13 -5
  19. data/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb +94 -0
  20. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +15 -7
  21. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +28 -5
  22. data/lib/google/cloud/discovery_engine/v1/document_service/client.rb +71 -33
  23. data/lib/google/cloud/discovery_engine/v1/document_service/operations.rb +13 -5
  24. data/lib/google/cloud/discovery_engine/v1/document_service/paths.rb +21 -0
  25. data/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +71 -33
  26. data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +28 -5
  27. data/lib/google/cloud/discovery_engine/v1/engine_service/client.rb +13 -5
  28. data/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb +13 -5
  29. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb +13 -5
  30. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +28 -5
  31. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb +471 -0
  32. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/credentials.rb +47 -0
  33. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/paths.rb +52 -0
  34. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb +438 -0
  35. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb +129 -0
  36. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest.rb +52 -0
  37. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service.rb +55 -0
  38. data/lib/google/cloud/discovery_engine/v1/project_service/client.rb +485 -0
  39. data/lib/google/cloud/discovery_engine/v1/project_service/credentials.rb +47 -0
  40. data/lib/google/cloud/discovery_engine/v1/project_service/operations.rb +809 -0
  41. data/lib/google/cloud/discovery_engine/v1/project_service/paths.rb +47 -0
  42. data/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb +452 -0
  43. data/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb +1114 -0
  44. data/lib/google/cloud/discovery_engine/v1/project_service/rest/service_stub.rb +129 -0
  45. data/lib/google/cloud/discovery_engine/v1/project_service/rest.rb +54 -0
  46. data/lib/google/cloud/discovery_engine/v1/project_service.rb +57 -0
  47. data/lib/google/cloud/discovery_engine/v1/rank_service/client.rb +481 -0
  48. data/lib/google/cloud/discovery_engine/v1/rank_service/credentials.rb +47 -0
  49. data/lib/google/cloud/discovery_engine/v1/rank_service/paths.rb +52 -0
  50. data/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb +448 -0
  51. data/lib/google/cloud/discovery_engine/v1/rank_service/rest/service_stub.rb +129 -0
  52. data/lib/google/cloud/discovery_engine/v1/rank_service/rest.rb +52 -0
  53. data/lib/google/cloud/discovery_engine/v1/rank_service.rb +55 -0
  54. data/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb +558 -0
  55. data/lib/google/cloud/discovery_engine/v1/recommendation_service/credentials.rb +47 -0
  56. data/lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb +220 -0
  57. data/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb +525 -0
  58. data/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/service_stub.rb +145 -0
  59. data/lib/google/cloud/discovery_engine/v1/recommendation_service/rest.rb +52 -0
  60. data/lib/google/cloud/discovery_engine/v1/recommendation_service.rb +55 -0
  61. data/lib/google/cloud/discovery_engine/v1/rest.rb +5 -0
  62. data/lib/google/cloud/discovery_engine/v1/schema_service/client.rb +18 -10
  63. data/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb +13 -5
  64. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb +18 -10
  65. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +28 -5
  66. data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +26 -13
  67. data/lib/google/cloud/discovery_engine/v1/search_service/paths.rb +45 -0
  68. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +26 -13
  69. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb +27 -12
  70. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb +13 -5
  71. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb +27 -12
  72. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +28 -5
  73. data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +23 -6
  74. data/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb +13 -5
  75. data/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb +21 -0
  76. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +23 -6
  77. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +28 -5
  78. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb +8 -0
  79. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  80. data/lib/google/cloud/discovery_engine/v1.rb +5 -0
  81. data/lib/google/cloud/discoveryengine/v1/answer_pb.rb +69 -0
  82. data/lib/google/cloud/discoveryengine/v1/common_pb.rb +2 -1
  83. data/lib/google/cloud/discoveryengine/v1/control_pb.rb +55 -0
  84. data/lib/google/cloud/discoveryengine/v1/control_service_pb.rb +57 -0
  85. data/lib/google/cloud/discoveryengine/v1/control_service_services_pb.rb +69 -0
  86. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +32 -1
  87. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb +25 -0
  88. data/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +5 -1
  89. data/lib/google/cloud/discoveryengine/v1/document_pb.rb +3 -1
  90. data/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb +48 -0
  91. data/lib/google/cloud/discoveryengine/v1/document_service_pb.rb +3 -1
  92. data/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb +1 -1
  93. data/lib/google/cloud/discoveryengine/v1/engine_pb.rb +1 -1
  94. data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb +52 -0
  95. data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb +45 -0
  96. data/lib/google/cloud/discoveryengine/v1/grounding_pb.rb +46 -0
  97. data/lib/google/cloud/discoveryengine/v1/import_config_pb.rb +13 -1
  98. data/lib/google/cloud/discoveryengine/v1/project_pb.rb +49 -0
  99. data/lib/google/cloud/discoveryengine/v1/project_service_pb.rb +50 -0
  100. data/lib/google/cloud/discoveryengine/v1/project_service_services_pb.rb +51 -0
  101. data/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb +1 -1
  102. data/lib/google/cloud/discoveryengine/v1/rank_service_pb.rb +49 -0
  103. data/lib/google/cloud/discoveryengine/v1/rank_service_services_pb.rb +45 -0
  104. data/lib/google/cloud/discoveryengine/v1/recommendation_service_pb.rb +55 -0
  105. data/lib/google/cloud/discoveryengine/v1/recommendation_service_services_pb.rb +45 -0
  106. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +4 -1
  107. data/lib/google/cloud/discoveryengine/v1/session_pb.rb +50 -0
  108. data/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb +1 -1
  109. data/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +1 -1
  110. data/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +1 -1
  111. data/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb +1 -1
  112. data/proto_docs/google/api/client.rb +4 -0
  113. data/proto_docs/google/cloud/discoveryengine/v1/answer.rb +362 -0
  114. data/proto_docs/google/cloud/discoveryengine/v1/common.rb +25 -1
  115. data/proto_docs/google/cloud/discoveryengine/v1/control.rb +207 -0
  116. data/proto_docs/google/cloud/discoveryengine/v1/control_service.rb +126 -0
  117. data/proto_docs/google/cloud/discoveryengine/v1/conversation.rb +2 -2
  118. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +490 -0
  119. data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +19 -0
  120. data/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb +2 -2
  121. data/proto_docs/google/cloud/discoveryengine/v1/document.rb +7 -0
  122. data/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb +102 -0
  123. data/proto_docs/google/cloud/discoveryengine/v1/document_service.rb +8 -4
  124. data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +5 -5
  125. data/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb +144 -0
  126. data/proto_docs/google/cloud/discoveryengine/v1/grounding.rb +79 -0
  127. data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +313 -24
  128. data/proto_docs/google/cloud/discoveryengine/v1/project.rb +106 -0
  129. data/proto_docs/google/cloud/discoveryengine/v1/project_service.rb +57 -0
  130. data/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +3 -0
  131. data/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb +124 -0
  132. data/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb +229 -0
  133. data/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb +5 -5
  134. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +150 -37
  135. data/proto_docs/google/cloud/discoveryengine/v1/session.rb +88 -0
  136. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb +3 -0
  137. data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +40 -14
  138. data/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb +13 -1
  139. metadata +66 -2
@@ -48,10 +48,14 @@ module Google
48
48
  # @!attribute [rw] page_size
49
49
  # @return [::Integer]
50
50
  # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to
51
- # return. If unspecified, defaults to a reasonable value. The maximum allowed
52
- # value is 100. Values above 100 are coerced to 100.
51
+ # return. The maximum allowed value depends on the data type. Values above
52
+ # the maximum value are coerced to the maximum value.
53
53
  #
54
- # If this field is negative, an `INVALID_ARGUMENT` is returned.
54
+ # * Websites with basic indexing: Default `10`, Maximum `25`.
55
+ # * Websites with advanced indexing: Default `25`, Maximum `50`.
56
+ # * Other: Default `50`, Maximum `100`.
57
+ #
58
+ # If this field is negative, an `INVALID_ARGUMENT` is returned.
55
59
  # @!attribute [rw] page_token
56
60
  # @return [::String]
57
61
  # A page token received from a previous
@@ -72,6 +76,12 @@ module Google
72
76
  # unset.
73
77
  #
74
78
  # If this field is negative, an `INVALID_ARGUMENT` is returned.
79
+ # @!attribute [rw] data_store_specs
80
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
81
+ # Specs defining dataStores to filter on in a search call and configurations
82
+ # for those dataStores. This is only considered for engines with multiple
83
+ # dataStores use case. For single dataStore within an engine, they should
84
+ # use the specs at the top level.
75
85
  # @!attribute [rw] filter
76
86
  # @return [::String]
77
87
  # The filter syntax consists of an expression language for constructing a
@@ -108,7 +118,9 @@ module Google
108
118
  # The order in which documents are returned. Documents can be ordered by
109
119
  # a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object.
110
120
  # Leave it unset if ordered by relevance. `order_by` expression is
111
- # case-sensitive. For more information on ordering, see
121
+ # case-sensitive.
122
+ #
123
+ # For more information on ordering for retail search, see
112
124
  # [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
113
125
  #
114
126
  # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
@@ -128,7 +140,7 @@ module Google
128
140
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
129
141
  # Boost specification to boost certain documents.
130
142
  # For more information on boosting, see
131
- # [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
143
+ # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
132
144
  # @!attribute [rw] params
133
145
  # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
134
146
  # Additional search parameters.
@@ -137,8 +149,7 @@ module Google
137
149
  #
138
150
  # * `user_country_code`: string. Default empty. If set to non-empty, results
139
151
  # are restricted or boosted based on the location provided.
140
- # Example:
141
- # user_country_code: "au"
152
+ # For example, `user_country_code: "au"`
142
153
  #
143
154
  # For available codes see [Country
144
155
  # Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes)
@@ -146,8 +157,7 @@ module Google
146
157
  # * `search_type`: double. Default empty. Enables non-webpage searching
147
158
  # depending on the value. The only valid non-default value is 1,
148
159
  # which enables image searching.
149
- # Example:
150
- # search_type: 1
160
+ # For example, `search_type: 1`
151
161
  # @!attribute [rw] query_expansion_spec
152
162
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec]
153
163
  # The query expansion specification that specifies the conditions under which
@@ -212,13 +222,26 @@ module Google
212
222
  extend ::Google::Protobuf::MessageExts::ClassMethods
213
223
  end
214
224
 
225
+ # A struct to define data stores to filter on in a search call and
226
+ # configurations for those data stores. A maximum of 1 DataStoreSpec per
227
+ # data_store is allowed. Otherwise, an `INVALID_ARGUMENT` error is returned.
228
+ # @!attribute [rw] data_store
229
+ # @return [::String]
230
+ # Required. Full resource name of
231
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as
232
+ # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
233
+ class DataStoreSpec
234
+ include ::Google::Protobuf::MessageExts
235
+ extend ::Google::Protobuf::MessageExts::ClassMethods
236
+ end
237
+
215
238
  # A facet specification to perform faceted search.
216
239
  # @!attribute [rw] facet_key
217
240
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey]
218
241
  # Required. The facet key specification.
219
242
  # @!attribute [rw] limit
220
243
  # @return [::Integer]
221
- # Maximum of facet values that should be returned for this facet. If
244
+ # Maximum facet values that are returned for this facet. If
222
245
  # unspecified, defaults to 20. The maximum allowed value is 300. Values
223
246
  # above 300 are coerced to 300.
224
247
  #
@@ -315,7 +338,7 @@ module Google
315
338
  # Only supported on textual fields. Maximum is 10.
316
339
  # @!attribute [rw] contains
317
340
  # @return [::Array<::String>]
318
- # Only get facet values that contains the given strings. For example,
341
+ # Only get facet values that contain the given strings. For example,
319
342
  # suppose "category" has three values "Action > 2022",
320
343
  # "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
321
344
  # "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
@@ -371,28 +394,29 @@ module Google
371
394
  # Examples:
372
395
  #
373
396
  # * To boost documents with document ID "doc_1" or "doc_2", and
374
- # color
375
- # "Red" or "Blue":
376
- # * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
397
+ # color "Red" or "Blue":
398
+ # `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
377
399
  # @!attribute [rw] boost
378
400
  # @return [::Float]
379
401
  # Strength of the condition boost, which should be in [-1, 1]. Negative
380
402
  # boost means demotion. Default is 0.0.
381
403
  #
382
- # Setting to 1.0 gives the document a big promotion. However, it does not
383
- # necessarily mean that the boosted document will be the top result at
384
- # all times, nor that other documents will be excluded. Results could
385
- # still be shown even when none of them matches the condition. And
386
- # results that are significantly more relevant to the search query can
387
- # still trump your heavily favored but irrelevant documents.
404
+ # Setting to 1.0 gives the document a big promotion. However, it does
405
+ # not necessarily mean that the boosted document will be the top result
406
+ # at all times, nor that other documents will be excluded. Results
407
+ # could still be shown even when none of them matches the condition.
408
+ # And results that are significantly more relevant to the search query
409
+ # can still trump your heavily favored but irrelevant documents.
388
410
  #
389
411
  # Setting to -1.0 gives the document a big demotion. However, results
390
412
  # that are deeply relevant might still be shown. The document will have
391
- # an upstream battle to get a fairly high ranking, but it is not blocked
392
- # out completely.
413
+ # an upstream battle to get a fairly high ranking, but it is not
414
+ # blocked out completely.
393
415
  #
394
416
  # Setting to 0.0 means no boost applied. The boosting condition is
395
- # ignored.
417
+ # ignored. Only one of the (condition, boost) combination or the
418
+ # boost_control_spec below are set. If both are set then the global boost
419
+ # is ignored and the more fine-grained boost_control_spec is applied.
396
420
  class ConditionBoostSpec
397
421
  include ::Google::Protobuf::MessageExts
398
422
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -434,8 +458,8 @@ module Google
434
458
  # The specification for query spell correction.
435
459
  # @!attribute [rw] mode
436
460
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode]
437
- # The mode under which spell correction should take effect to
438
- # replace the original search query. Default to
461
+ # The mode under which spell correction
462
+ # replaces the original search query. Defaults to
439
463
  # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
440
464
  class SpellCorrectionSpec
441
465
  include ::Google::Protobuf::MessageExts
@@ -448,10 +472,10 @@ module Google
448
472
  # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
449
473
  MODE_UNSPECIFIED = 0
450
474
 
451
- # Search API will try to find a spell suggestion if there
452
- # is any and put in the
475
+ # Search API tries to find a spelling suggestion. If a suggestion is
476
+ # found, it is put in the
453
477
  # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#corrected_query SearchResponse.corrected_query}.
454
- # The spell suggestion will not be used as the search query.
478
+ # The spelling suggestion won't be used as the search query.
455
479
  SUGGESTION_ONLY = 1
456
480
 
457
481
  # Automatic spell correction built by the Search API. Search will
@@ -469,6 +493,10 @@ module Google
469
493
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec]
470
494
  # If `summarySpec` is not specified, summaries are not included in the
471
495
  # search response.
496
+ # @!attribute [rw] extractive_content_spec
497
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
498
+ # If there is no extractive_content_spec provided, there will be no
499
+ # extractive answer in the search response.
472
500
  class ContentSearchSpec
473
501
  include ::Google::Protobuf::MessageExts
474
502
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -503,7 +531,10 @@ module Google
503
531
  # of results returned is less than `summaryResultCount`, the summary is
504
532
  # generated from all of the results.
505
533
  #
506
- # At most five results can be used to generate a summary.
534
+ # At most 10 results for documents mode, or 50 for chunks mode, can be
535
+ # used to generate a summary. The chunks mode is used when
536
+ # [SearchRequest.ContentSearchSpec.search_result_mode][] is set to
537
+ # [CHUNKS][SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS].
507
538
  # @!attribute [rw] include_citations
508
539
  # @return [::Boolean]
509
540
  # Specifies whether to include citations in the summary. The default
@@ -561,6 +592,14 @@ module Google
561
592
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
562
593
  # If specified, the spec will be used to modify the model specification
563
594
  # provided to the LLM.
595
+ # @!attribute [rw] use_semantic_chunks
596
+ # @return [::Boolean]
597
+ # If true, answer will be generated from most relevant chunks from top
598
+ # search results. This feature will improve summary quality.
599
+ # Note that with this feature enabled, not all top search results
600
+ # will be referenced and included in the reference list, so the citation
601
+ # source index only points to the search results listed in the reference
602
+ # list.
564
603
  class SummarySpec
565
604
  include ::Google::Protobuf::MessageExts
566
605
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -583,16 +622,75 @@ module Google
583
622
  # Supported values are:
584
623
  #
585
624
  # * `stable`: string. Default value when no value is specified. Uses a
586
- # generally available, fine-tuned version of the text-bison@001
587
- # model.
588
- # * `preview`: string. (Public preview) Uses a fine-tuned version of
589
- # the text-bison@002 model. This model works only for summaries in
590
- # English.
625
+ # generally available, fine-tuned model. For more information, see
626
+ # [Answer generation model versions and
627
+ # lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
628
+ # * `preview`: string. (Public preview) Uses a preview model. For more
629
+ # information, see
630
+ # [Answer generation model versions and
631
+ # lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
591
632
  class ModelSpec
592
633
  include ::Google::Protobuf::MessageExts
593
634
  extend ::Google::Protobuf::MessageExts::ClassMethods
594
635
  end
595
636
  end
637
+
638
+ # A specification for configuring the extractive content in a search
639
+ # response.
640
+ # @!attribute [rw] max_extractive_answer_count
641
+ # @return [::Integer]
642
+ # The maximum number of extractive answers returned in each search
643
+ # result.
644
+ #
645
+ # An extractive answer is a verbatim answer extracted from the original
646
+ # document, which provides a precise and contextually relevant answer to
647
+ # the search query.
648
+ #
649
+ # If the number of matching answers is less than the
650
+ # `max_extractive_answer_count`, return all of the answers. Otherwise,
651
+ # return the `max_extractive_answer_count`.
652
+ #
653
+ # At most five answers are returned for each
654
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult SearchResult}.
655
+ # @!attribute [rw] max_extractive_segment_count
656
+ # @return [::Integer]
657
+ # The max number of extractive segments returned in each search result.
658
+ # Only applied if the
659
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} is set to
660
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
661
+ # or
662
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore#solution_types DataStore.solution_types}
663
+ # is
664
+ # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
665
+ #
666
+ # An extractive segment is a text segment extracted from the original
667
+ # document that is relevant to the search query, and, in general, more
668
+ # verbose than an extractive answer. The segment could then be used as
669
+ # input for LLMs to generate summaries and answers.
670
+ #
671
+ # If the number of matching segments is less than
672
+ # `max_extractive_segment_count`, return all of the segments. Otherwise,
673
+ # return the `max_extractive_segment_count`.
674
+ # @!attribute [rw] return_extractive_segment_score
675
+ # @return [::Boolean]
676
+ # Specifies whether to return the confidence score from the extractive
677
+ # segments in each search result. This feature is available only for new
678
+ # or allowlisted data stores. To allowlist your data store,
679
+ # contact your Customer Engineer. The default value is `false`.
680
+ # @!attribute [rw] num_previous_segments
681
+ # @return [::Integer]
682
+ # Specifies whether to also include the adjacent from each selected
683
+ # segments.
684
+ # Return at most `num_previous_segments` segments before each selected
685
+ # segments.
686
+ # @!attribute [rw] num_next_segments
687
+ # @return [::Integer]
688
+ # Return at most `num_next_segments` segments after each selected
689
+ # segments.
690
+ class ExtractiveContentSpec
691
+ include ::Google::Protobuf::MessageExts
692
+ extend ::Google::Protobuf::MessageExts::ClassMethods
693
+ end
596
694
  end
597
695
 
598
696
  # @!attribute [rw] key
@@ -676,7 +774,7 @@ module Google
676
774
  # @!attribute [rw] document
677
775
  # @return [::Google::Cloud::DiscoveryEngine::V1::Document]
678
776
  # The document data snippet in the search response. Only fields that are
679
- # marked as retrievable are populated.
777
+ # marked as `retrievable` are populated.
680
778
  class SearchResult
681
779
  include ::Google::Protobuf::MessageExts
682
780
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -685,7 +783,7 @@ module Google
685
783
  # A facet result.
686
784
  # @!attribute [rw] key
687
785
  # @return [::String]
688
- # The key for this facet. E.g., "colors" or "price". It matches
786
+ # The key for this facet. For example, `"colors"` or `"price"`. It matches
689
787
  # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
690
788
  # @!attribute [rw] values
691
789
  # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
@@ -715,7 +813,7 @@ module Google
715
813
  end
716
814
  end
717
815
 
718
- # Summary of the top N search result specified by the summary spec.
816
+ # Summary of the top N search results specified by the summary spec.
719
817
  # @!attribute [rw] summary_text
720
818
  # @return [::String]
721
819
  # The summary content.
@@ -796,9 +894,24 @@ module Google
796
894
  # @!attribute [rw] uri
797
895
  # @return [::String]
798
896
  # Cloud Storage or HTTP uri for the document.
897
+ # @!attribute [rw] chunk_contents
898
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>]
899
+ # List of cited chunk contents derived from document content.
799
900
  class Reference
800
901
  include ::Google::Protobuf::MessageExts
801
902
  extend ::Google::Protobuf::MessageExts::ClassMethods
903
+
904
+ # Chunk content.
905
+ # @!attribute [rw] content
906
+ # @return [::String]
907
+ # Chunk textual content.
908
+ # @!attribute [rw] page_identifier
909
+ # @return [::String]
910
+ # Page identifier.
911
+ class ChunkContent
912
+ include ::Google::Protobuf::MessageExts
913
+ extend ::Google::Protobuf::MessageExts::ClassMethods
914
+ end
802
915
  end
803
916
 
804
917
  # Summary with metadata information.
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module DiscoveryEngine
23
+ module V1
24
+ # External session proto definition.
25
+ # @!attribute [rw] name
26
+ # @return [::String]
27
+ # Immutable. Fully qualified name
28
+ # `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*`
29
+ # @!attribute [rw] state
30
+ # @return [::Google::Cloud::DiscoveryEngine::V1::Session::State]
31
+ # The state of the session.
32
+ # @!attribute [rw] user_pseudo_id
33
+ # @return [::String]
34
+ # A unique identifier for tracking users.
35
+ # @!attribute [rw] turns
36
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Session::Turn>]
37
+ # Turns.
38
+ # @!attribute [r] start_time
39
+ # @return [::Google::Protobuf::Timestamp]
40
+ # Output only. The time the session started.
41
+ # @!attribute [r] end_time
42
+ # @return [::Google::Protobuf::Timestamp]
43
+ # Output only. The time the session finished.
44
+ class Session
45
+ include ::Google::Protobuf::MessageExts
46
+ extend ::Google::Protobuf::MessageExts::ClassMethods
47
+
48
+ # Represents a turn, including a query from the user and a
49
+ # answer from service.
50
+ # @!attribute [rw] query
51
+ # @return [::Google::Cloud::DiscoveryEngine::V1::Query]
52
+ # The user query.
53
+ # @!attribute [rw] answer
54
+ # @return [::String]
55
+ # The resource name of the answer to the user query.
56
+ #
57
+ # Only set if the answer generation (/answer API call) happened in this
58
+ # turn.
59
+ class Turn
60
+ include ::Google::Protobuf::MessageExts
61
+ extend ::Google::Protobuf::MessageExts::ClassMethods
62
+ end
63
+
64
+ # Enumeration of the state of the session.
65
+ module State
66
+ # State is unspecified.
67
+ STATE_UNSPECIFIED = 0
68
+
69
+ # The session is currently open.
70
+ IN_PROGRESS = 1
71
+ end
72
+ end
73
+
74
+ # Defines a user inputed query.
75
+ # @!attribute [rw] text
76
+ # @return [::String]
77
+ # Plain text.
78
+ # @!attribute [rw] query_id
79
+ # @return [::String]
80
+ # Unique Id for the query.
81
+ class Query
82
+ include ::Google::Protobuf::MessageExts
83
+ extend ::Google::Protobuf::MessageExts::ClassMethods
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
@@ -57,6 +57,9 @@ module Google
57
57
  # @!attribute [r] generated_uri_pattern
58
58
  # @return [::String]
59
59
  # Output only. This is system-generated based on the provided_uri_pattern.
60
+ # @!attribute [r] root_domain_uri
61
+ # @return [::String]
62
+ # Output only. Root domain of the provided_uri_pattern.
60
63
  # @!attribute [r] site_verification_info
61
64
  # @return [::Google::Cloud::DiscoveryEngine::V1::SiteVerificationInfo]
62
65
  # Output only. Site ownership and validity verification status.
@@ -22,7 +22,7 @@ module Google
22
22
  module DiscoveryEngine
23
23
  module V1
24
24
  # UserEvent captures all metadata information Discovery Engine API needs to
25
- # know about how end users interact with customers' website.
25
+ # know about how end users interact with your website.
26
26
  # @!attribute [rw] event_type
27
27
  # @return [::String]
28
28
  # Required. User event type. Allowed values are:
@@ -63,6 +63,27 @@ module Google
63
63
  # Analytics [Client
64
64
  # ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
65
65
  # for this field.
66
+ # @!attribute [rw] engine
67
+ # @return [::String]
68
+ # The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} resource name, in the
69
+ # form of
70
+ # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`.
71
+ #
72
+ # Optional. Only required for
73
+ # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} produced user events. For
74
+ # example, user events from blended search.
75
+ # @!attribute [rw] data_store
76
+ # @return [::String]
77
+ # The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} resource full
78
+ # name, of the form
79
+ # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
80
+ #
81
+ # Optional. Only required for user events whose data store can't by
82
+ # determined by
83
+ # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#engine UserEvent.engine} or
84
+ # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#documents UserEvent.documents}.
85
+ # If data store is set in the parent of write/import/collect user event
86
+ # requests, this field can be omitted.
66
87
  # @!attribute [rw] event_time
67
88
  # @return [::Google::Protobuf::Timestamp]
68
89
  # Only required for
@@ -105,22 +126,26 @@ module Google
105
126
  # Token to attribute an API response to user action(s) to trigger the event.
106
127
  #
107
128
  # Highly recommended for user events that are the result of
108
- # [RecommendationService.Recommend][]. This field enables accurate
109
- # attribution of recommendation model performance.
129
+ # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend RecommendationService.Recommend}.
130
+ # This field enables accurate attribution of recommendation model
131
+ # performance.
110
132
  #
111
133
  # The value must be one of:
112
134
  #
113
- # * [RecommendResponse.attribution_token][] for events that are the result of
114
- # [RecommendationService.Recommend][].
135
+ # * {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse#attribution_token RecommendResponse.attribution_token} for events that are the result of
136
+ # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend RecommendationService.Recommend}.
115
137
  # * {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#attribution_token SearchResponse.attribution_token} for events that are the result of
116
138
  # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search}.
117
139
  #
118
140
  # This token enables us to accurately attribute page view or conversion
119
141
  # completion back to the event and the particular predict response containing
120
142
  # this clicked/purchased product. If user clicks on product K in the
121
- # recommendation results, pass [RecommendResponse.attribution_token][] as a
122
- # URL parameter to product K's page. When recording events on product K's
123
- # page, log the [RecommendResponse.attribution_token][] to this field.
143
+ # recommendation results, pass
144
+ # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse#attribution_token RecommendResponse.attribution_token}
145
+ # as a URL parameter to product K's page. When recording events on product
146
+ # K's page, log the
147
+ # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse#attribution_token RecommendResponse.attribution_token}
148
+ # to this field.
124
149
  # @!attribute [rw] filter
125
150
  # @return [::String]
126
151
  # The filter syntax consists of an expression language for constructing a
@@ -133,9 +158,10 @@ module Google
133
158
  # conforming to https://google.aip.dev/160#filtering.
134
159
  #
135
160
  # Similarly, for `view-item-list` events that are generated from a
136
- # [RecommendRequest][], this field may be populated directly from
137
- # [RecommendRequest.filter][] conforming to
138
- # https://google.aip.dev/160#filtering.
161
+ # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest RecommendRequest}, this
162
+ # field may be populated directly from
163
+ # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#filter RecommendRequest.filter}
164
+ # conforming to https://google.aip.dev/160#filtering.
139
165
  #
140
166
  # The value must be a UTF-8 encoded string with a length limit of 1,000
141
167
  # characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
@@ -182,7 +208,7 @@ module Google
182
208
  # @return [::Array<::String>]
183
209
  # A list of identifiers for the independent experiment groups this user event
184
210
  # belongs to. This is used to distinguish between user events associated with
185
- # different experiment setups on the customer end.
211
+ # different experiment setups.
186
212
  # @!attribute [rw] promotion_ids
187
213
  # @return [::Array<::String>]
188
214
  # The promotion IDs if this is an event associated with promotions.
@@ -250,7 +276,7 @@ module Google
250
276
  # The most specific category associated with a category page.
251
277
  #
252
278
  # To represent full path of category, use '>' sign to separate different
253
- # hierarchies. If '>' is part of the category name, please replace it with
279
+ # hierarchies. If '>' is part of the category name, replace it with
254
280
  # other character(s).
255
281
  #
256
282
  # Category pages include special pages such as sales or promotions. For
@@ -410,7 +436,7 @@ module Google
410
436
  # @return [::Integer]
411
437
  # Quantity of the Document associated with the user event. Defaults to 1.
412
438
  #
413
- # For example, this field will be 2 if two quantities of the same Document
439
+ # For example, this field is 2 if two quantities of the same Document
414
440
  # are involved in a `add-to-cart` event.
415
441
  #
416
442
  # Required for events of the following event types:
@@ -24,11 +24,23 @@ module Google
24
24
  # Request message for WriteUserEvent method.
25
25
  # @!attribute [rw] parent
26
26
  # @return [::String]
27
- # Required. The parent DataStore resource name, such as
27
+ # Required. The parent resource name.
28
+ # If the write user event action is applied in
29
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} level, the format
30
+ # is:
28
31
  # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
32
+ # If the write user event action is applied in [Location][] level, for
33
+ # example, the event with
34
+ # {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple
35
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is:
36
+ # `projects/{project}/locations/{location}`.
29
37
  # @!attribute [rw] user_event
30
38
  # @return [::Google::Cloud::DiscoveryEngine::V1::UserEvent]
31
39
  # Required. User event to write.
40
+ # @!attribute [rw] write_async
41
+ # @return [::Boolean]
42
+ # If set to true, the user event is written asynchronously after
43
+ # validation, and the API responds without waiting for the write.
32
44
  class WriteUserEventRequest
33
45
  include ::Google::Protobuf::MessageExts
34
46
  extend ::Google::Protobuf::MessageExts::ClassMethods