google-cloud-discovery_engine-v1 0.7.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +228 -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 +214 -3
  5. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +28 -5
  6. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb +136 -0
  7. data/lib/google/cloud/discovery_engine/v1/control_service/client.rb +875 -0
  8. data/lib/google/cloud/discovery_engine/v1/control_service/credentials.rb +47 -0
  9. data/lib/google/cloud/discovery_engine/v1/control_service/paths.rb +167 -0
  10. data/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb +814 -0
  11. data/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb +440 -0
  12. data/lib/google/cloud/discovery_engine/v1/control_service/rest.rb +55 -0
  13. data/lib/google/cloud/discovery_engine/v1/control_service.rb +58 -0
  14. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +911 -135
  15. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb +199 -0
  16. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +733 -6
  17. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +520 -0
  18. data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +15 -7
  19. data/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb +13 -5
  20. data/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb +45 -0
  21. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +15 -7
  22. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +28 -5
  23. data/lib/google/cloud/discovery_engine/v1/document_service/client.rb +26 -14
  24. data/lib/google/cloud/discovery_engine/v1/document_service/operations.rb +13 -5
  25. data/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +26 -14
  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 +24 -19
  55. data/lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb +66 -0
  56. data/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb +24 -19
  57. data/lib/google/cloud/discovery_engine/v1/rest.rb +4 -0
  58. data/lib/google/cloud/discovery_engine/v1/schema_service/client.rb +18 -10
  59. data/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb +13 -5
  60. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb +18 -10
  61. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +28 -5
  62. data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +57 -9
  63. data/lib/google/cloud/discovery_engine/v1/search_service/paths.rb +68 -0
  64. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +57 -9
  65. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb +27 -12
  66. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb +13 -5
  67. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb +27 -12
  68. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +28 -5
  69. data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +23 -6
  70. data/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb +13 -5
  71. data/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb +21 -0
  72. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +23 -6
  73. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +28 -5
  74. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb +15 -0
  75. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  76. data/lib/google/cloud/discovery_engine/v1.rb +4 -0
  77. data/lib/google/cloud/discoveryengine/v1/answer_pb.rb +69 -0
  78. data/lib/google/cloud/discoveryengine/v1/chunk_pb.rb +50 -0
  79. data/lib/google/cloud/discoveryengine/v1/common_pb.rb +2 -1
  80. data/lib/google/cloud/discoveryengine/v1/completion_pb.rb +2 -1
  81. data/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb +1 -1
  82. data/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb +8 -0
  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 +3 -1
  89. data/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb +51 -0
  90. data/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb +1 -1
  91. data/lib/google/cloud/discoveryengine/v1/engine_pb.rb +1 -1
  92. data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb +52 -0
  93. data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb +45 -0
  94. data/lib/google/cloud/discoveryengine/v1/grounding_pb.rb +46 -0
  95. data/lib/google/cloud/discoveryengine/v1/import_config_pb.rb +6 -1
  96. data/lib/google/cloud/discoveryengine/v1/project_pb.rb +49 -0
  97. data/lib/google/cloud/discoveryengine/v1/project_service_pb.rb +50 -0
  98. data/lib/google/cloud/discoveryengine/v1/project_service_services_pb.rb +51 -0
  99. data/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb +4 -1
  100. data/lib/google/cloud/discoveryengine/v1/rank_service_pb.rb +49 -0
  101. data/lib/google/cloud/discoveryengine/v1/rank_service_services_pb.rb +45 -0
  102. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +9 -1
  103. data/lib/google/cloud/discoveryengine/v1/session_pb.rb +50 -0
  104. data/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb +1 -1
  105. data/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +1 -1
  106. data/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +1 -1
  107. data/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb +1 -1
  108. data/proto_docs/google/cloud/discoveryengine/v1/answer.rb +375 -0
  109. data/proto_docs/google/cloud/discoveryengine/v1/chunk.rb +119 -0
  110. data/proto_docs/google/cloud/discoveryengine/v1/common.rb +16 -0
  111. data/proto_docs/google/cloud/discoveryengine/v1/completion.rb +31 -0
  112. data/proto_docs/google/cloud/discoveryengine/v1/control.rb +207 -0
  113. data/proto_docs/google/cloud/discoveryengine/v1/control_service.rb +126 -0
  114. data/proto_docs/google/cloud/discoveryengine/v1/conversation.rb +2 -2
  115. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +529 -0
  116. data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +3 -0
  117. data/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb +2 -2
  118. data/proto_docs/google/cloud/discoveryengine/v1/document.rb +1 -1
  119. data/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb +143 -0
  120. data/proto_docs/google/cloud/discoveryengine/v1/document_service.rb +5 -5
  121. data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +3 -3
  122. data/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb +144 -0
  123. data/proto_docs/google/cloud/discoveryengine/v1/grounding.rb +79 -0
  124. data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +118 -4
  125. data/proto_docs/google/cloud/discoveryengine/v1/project.rb +106 -0
  126. data/proto_docs/google/cloud/discoveryengine/v1/project_service.rb +57 -0
  127. data/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +42 -0
  128. data/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb +124 -0
  129. data/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb +20 -19
  130. data/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb +5 -5
  131. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +230 -20
  132. data/proto_docs/google/cloud/discoveryengine/v1/session.rb +88 -0
  133. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb +3 -0
  134. data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +24 -3
  135. data/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb +13 -1
  136. metadata +58 -2
@@ -78,7 +78,10 @@ module Google
78
78
  # If this field is negative, an `INVALID_ARGUMENT` is returned.
79
79
  # @!attribute [rw] data_store_specs
80
80
  # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
81
- # A list of data store specs to apply on a search call.
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.
82
85
  # @!attribute [rw] filter
83
86
  # @return [::String]
84
87
  # The filter syntax consists of an expression language for constructing a
@@ -115,7 +118,9 @@ module Google
115
118
  # The order in which documents are returned. Documents can be ordered by
116
119
  # a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object.
117
120
  # Leave it unset if ordered by relevance. `order_by` expression is
118
- # case-sensitive. For more information on ordering, see
121
+ # case-sensitive.
122
+ #
123
+ # For more information on ordering for retail search, see
119
124
  # [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
120
125
  #
121
126
  # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
@@ -125,6 +130,13 @@ module Google
125
130
  # Highly recommended for analytics.
126
131
  # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent}
127
132
  # is used to deduce `device_type` for analytics.
133
+ # @!attribute [rw] language_code
134
+ # @return [::String]
135
+ # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
136
+ # information, see [Standard
137
+ # fields](https://cloud.google.com/apis/design/standard_fields). This field
138
+ # helps to better interpret the query. If a value isn't specified, the query
139
+ # language code is automatically detected, which may not be accurate.
128
140
  # @!attribute [rw] facet_specs
129
141
  # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec>]
130
142
  # Facet specifications for faceted search. If empty, no facets are returned.
@@ -135,7 +147,7 @@ module Google
135
147
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
136
148
  # Boost specification to boost certain documents.
137
149
  # For more information on boosting, see
138
- # [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
150
+ # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
139
151
  # @!attribute [rw] params
140
152
  # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
141
153
  # Additional search parameters.
@@ -144,8 +156,7 @@ module Google
144
156
  #
145
157
  # * `user_country_code`: string. Default empty. If set to non-empty, results
146
158
  # are restricted or boosted based on the location provided.
147
- # Example:
148
- # user_country_code: "au"
159
+ # For example, `user_country_code: "au"`
149
160
  #
150
161
  # For available codes see [Country
151
162
  # Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes)
@@ -153,8 +164,7 @@ module Google
153
164
  # * `search_type`: double. Default empty. Enables non-webpage searching
154
165
  # depending on the value. The only valid non-default value is 1,
155
166
  # which enables image searching.
156
- # Example:
157
- # search_type: 1
167
+ # For example, `search_type: 1`
158
168
  # @!attribute [rw] query_expansion_spec
159
169
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec]
160
170
  # The query expansion specification that specifies the conditions under which
@@ -205,6 +215,44 @@ module Google
205
215
  # See [Google Cloud
206
216
  # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
207
217
  # for more details.
218
+ # @!attribute [rw] search_as_you_type_spec
219
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec]
220
+ # Search as you type configuration. Only supported for the
221
+ # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA}
222
+ # vertical.
223
+ # @!attribute [rw] session
224
+ # @return [::String]
225
+ # The session resource name. Optional.
226
+ #
227
+ # Session allows users to do multi-turn /search API calls or coordination
228
+ # between /search API calls and /answer API calls.
229
+ #
230
+ # Example #1 (multi-turn /search API calls):
231
+ # 1. Call /search API with the auto-session mode (see below).
232
+ # 2. Call /search API with the session ID generated in the first call.
233
+ # Here, the previous search query gets considered in query
234
+ # standing. I.e., if the first query is "How did Alphabet do in 2022?"
235
+ # and the current query is "How about 2023?", the current query will
236
+ # be interpreted as "How did Alphabet do in 2023?".
237
+ #
238
+ # Example #2 (coordination between /search API calls and /answer API calls):
239
+ # 1. Call /search API with the auto-session mode (see below).
240
+ # 2. Call /answer API with the session ID generated in the first call.
241
+ # Here, the answer generation happens in the context of the search
242
+ # results from the first search call.
243
+ #
244
+ # Auto-session mode: when `projects/.../sessions/-` is used, a new session
245
+ # gets automatically created. Otherwise, users can use the create-session API
246
+ # to create a session manually.
247
+ #
248
+ # Multi-turn Search feature is currently at private GA stage. Please use
249
+ # v1alpha or v1beta version instead before we launch this feature to public
250
+ # GA. Or ask for allowlisting through Google Support team.
251
+ # @!attribute [rw] session_spec
252
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec]
253
+ # Session specification.
254
+ #
255
+ # Can be used only when `session` is set.
208
256
  class SearchRequest
209
257
  include ::Google::Protobuf::MessageExts
210
258
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -219,7 +267,9 @@ module Google
219
267
  extend ::Google::Protobuf::MessageExts::ClassMethods
220
268
  end
221
269
 
222
- # A struct to define data stores to filter on in a search call.
270
+ # A struct to define data stores to filter on in a search call and
271
+ # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
272
+ # error is returned.
223
273
  # @!attribute [rw] data_store
224
274
  # @return [::String]
225
275
  # Required. Full resource name of
@@ -236,9 +286,12 @@ module Google
236
286
  # Required. The facet key specification.
237
287
  # @!attribute [rw] limit
238
288
  # @return [::Integer]
239
- # Maximum of facet values that should be returned for this facet. If
289
+ # Maximum facet values that are returned for this facet. If
240
290
  # unspecified, defaults to 20. The maximum allowed value is 300. Values
241
291
  # above 300 are coerced to 300.
292
+ # For aggregation in healthcare search, when the [FacetKey.key] is
293
+ # "healthcare_aggregation_key", the limit will be overridden to
294
+ # 10,000 internally, regardless of the value set here.
242
295
  #
243
296
  # If this field is negative, an `INVALID_ARGUMENT` is returned.
244
297
  # @!attribute [rw] excluded_filter_keys
@@ -333,7 +386,7 @@ module Google
333
386
  # Only supported on textual fields. Maximum is 10.
334
387
  # @!attribute [rw] contains
335
388
  # @return [::Array<::String>]
336
- # Only get facet values that contains the given strings. For example,
389
+ # Only get facet values that contain the given strings. For example,
337
390
  # suppose "category" has three values "Action > 2022",
338
391
  # "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
339
392
  # "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
@@ -453,8 +506,8 @@ module Google
453
506
  # The specification for query spell correction.
454
507
  # @!attribute [rw] mode
455
508
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode]
456
- # The mode under which spell correction should take effect to
457
- # replace the original search query. Default to
509
+ # The mode under which spell correction
510
+ # replaces the original search query. Defaults to
458
511
  # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
459
512
  class SpellCorrectionSpec
460
513
  include ::Google::Protobuf::MessageExts
@@ -467,10 +520,10 @@ module Google
467
520
  # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
468
521
  MODE_UNSPECIFIED = 0
469
522
 
470
- # Search API will try to find a spell suggestion if there
471
- # is any and put in the
523
+ # Search API tries to find a spelling suggestion. If a suggestion is
524
+ # found, it is put in the
472
525
  # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#corrected_query SearchResponse.corrected_query}.
473
- # The spell suggestion will not be used as the search query.
526
+ # The spelling suggestion won't be used as the search query.
474
527
  SUGGESTION_ONLY = 1
475
528
 
476
529
  # Automatic spell correction built by the Search API. Search will
@@ -492,6 +545,21 @@ module Google
492
545
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
493
546
  # If there is no extractive_content_spec provided, there will be no
494
547
  # extractive answer in the search response.
548
+ # @!attribute [rw] search_result_mode
549
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
550
+ # Specifies the search result mode. If unspecified, the
551
+ # search result mode is based on
552
+ # [DataStore.DocumentProcessingConfig.chunking_config][]:
553
+ # * If [DataStore.DocumentProcessingConfig.chunking_config][] is specified,
554
+ # it defaults to `CHUNKS`.
555
+ # * Otherwise, it defaults to `DOCUMENTS`.
556
+ # @!attribute [rw] chunk_spec
557
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::ChunkSpec]
558
+ # Specifies the chunk spec to be returned from the search response.
559
+ # Only available if the
560
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
561
+ # is set to
562
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
495
563
  class ContentSearchSpec
496
564
  include ::Google::Protobuf::MessageExts
497
565
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -528,8 +596,9 @@ module Google
528
596
  #
529
597
  # At most 10 results for documents mode, or 50 for chunks mode, can be
530
598
  # used to generate a summary. The chunks mode is used when
531
- # [SearchRequest.ContentSearchSpec.search_result_mode][] is set to
532
- # [CHUNKS][SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS].
599
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
600
+ # is set to
601
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
533
602
  # @!attribute [rw] include_citations
534
603
  # @return [::Boolean]
535
604
  # Specifies whether to include citations in the summary. The default
@@ -686,6 +755,114 @@ module Google
686
755
  include ::Google::Protobuf::MessageExts
687
756
  extend ::Google::Protobuf::MessageExts::ClassMethods
688
757
  end
758
+
759
+ # Specifies the chunk spec to be returned from the search response.
760
+ # Only available if the
761
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
762
+ # is set to
763
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
764
+ # @!attribute [rw] num_previous_chunks
765
+ # @return [::Integer]
766
+ # The number of previous chunks to be returned of the current chunk. The
767
+ # maximum allowed value is 3.
768
+ # If not specified, no previous chunks will be returned.
769
+ # @!attribute [rw] num_next_chunks
770
+ # @return [::Integer]
771
+ # The number of next chunks to be returned of the current chunk. The
772
+ # maximum allowed value is 3.
773
+ # If not specified, no next chunks will be returned.
774
+ class ChunkSpec
775
+ include ::Google::Protobuf::MessageExts
776
+ extend ::Google::Protobuf::MessageExts::ClassMethods
777
+ end
778
+
779
+ # Specifies the search result mode. If unspecified, the
780
+ # search result mode is based on
781
+ # [DataStore.DocumentProcessingConfig.chunking_config][]:
782
+ # * If [DataStore.DocumentProcessingConfig.chunking_config][] is specified,
783
+ # it defaults to `CHUNKS`.
784
+ # * Otherwise, it defaults to `DOCUMENTS`.
785
+ module SearchResultMode
786
+ # Default value.
787
+ SEARCH_RESULT_MODE_UNSPECIFIED = 0
788
+
789
+ # Returns documents in the search result.
790
+ DOCUMENTS = 1
791
+
792
+ # Returns chunks in the search result. Only available if the
793
+ # [DataStore.DocumentProcessingConfig.chunking_config][] is specified.
794
+ CHUNKS = 2
795
+ end
796
+ end
797
+
798
+ # Specification for search as you type in search requests.
799
+ # @!attribute [rw] condition
800
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec::Condition]
801
+ # The condition under which search as you type should occur.
802
+ # Default to
803
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
804
+ class SearchAsYouTypeSpec
805
+ include ::Google::Protobuf::MessageExts
806
+ extend ::Google::Protobuf::MessageExts::ClassMethods
807
+
808
+ # Enum describing under which condition search as you type should occur.
809
+ module Condition
810
+ # Server behavior defaults to
811
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
812
+ CONDITION_UNSPECIFIED = 0
813
+
814
+ # Disables Search As You Type.
815
+ DISABLED = 1
816
+
817
+ # Enables Search As You Type.
818
+ ENABLED = 2
819
+ end
820
+ end
821
+
822
+ # Session specification.
823
+ #
824
+ # Multi-turn Search feature is currently at private GA stage. Please use
825
+ # v1alpha or v1beta version instead before we launch this feature to public
826
+ # GA. Or ask for allowlisting through Google Support team.
827
+ # @!attribute [rw] query_id
828
+ # @return [::String]
829
+ # If set, the search result gets stored to the "turn" specified by this
830
+ # query ID.
831
+ #
832
+ # Example: Let's say the session looks like this:
833
+ # session {
834
+ # name: ".../sessions/xxx"
835
+ # turns {
836
+ # query { text: "What is foo?" query_id: ".../questions/yyy" }
837
+ # answer: "Foo is ..."
838
+ # }
839
+ # turns {
840
+ # query { text: "How about bar then?" query_id: ".../questions/zzz" }
841
+ # }
842
+ # }
843
+ #
844
+ # The user can call /search API with a request like this:
845
+ #
846
+ # session: ".../sessions/xxx"
847
+ # session_spec { query_id: ".../questions/zzz" }
848
+ #
849
+ # Then, the API stores the search result, associated with the last turn.
850
+ # The stored search result can be used by a subsequent /answer API call
851
+ # (with the session ID and the query ID specified). Also, it is possible
852
+ # to call /search and /answer in parallel with the same session ID & query
853
+ # ID.
854
+ # @!attribute [rw] search_result_persistence_count
855
+ # @return [::Integer]
856
+ # The number of top search results to persist. The persisted search results
857
+ # can be used for the subsequent /answer api call.
858
+ #
859
+ # This field is simliar to the `summary_result_count` field in
860
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
861
+ #
862
+ # At most 10 results for documents mode, or 50 for chunks mode.
863
+ class SessionSpec
864
+ include ::Google::Protobuf::MessageExts
865
+ extend ::Google::Protobuf::MessageExts::ClassMethods
689
866
  end
690
867
 
691
868
  # @!attribute [rw] key
@@ -757,6 +934,13 @@ module Google
757
934
  # @!attribute [rw] query_expansion_info
758
935
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::QueryExpansionInfo]
759
936
  # Query expansion information for the returned results.
937
+ # @!attribute [rw] session_info
938
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SessionInfo]
939
+ # Session information.
940
+ #
941
+ # Only set if
942
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session}
943
+ # is provided. See its description for more details.
760
944
  class SearchResponse
761
945
  include ::Google::Protobuf::MessageExts
762
946
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -769,7 +953,13 @@ module Google
769
953
  # @!attribute [rw] document
770
954
  # @return [::Google::Cloud::DiscoveryEngine::V1::Document]
771
955
  # The document data snippet in the search response. Only fields that are
772
- # marked as retrievable are populated.
956
+ # marked as `retrievable` are populated.
957
+ # @!attribute [rw] chunk
958
+ # @return [::Google::Cloud::DiscoveryEngine::V1::Chunk]
959
+ # The chunk data in the search response if the
960
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
961
+ # is set to
962
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
773
963
  class SearchResult
774
964
  include ::Google::Protobuf::MessageExts
775
965
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -778,7 +968,7 @@ module Google
778
968
  # A facet result.
779
969
  # @!attribute [rw] key
780
970
  # @return [::String]
781
- # The key for this facet. E.g., "colors" or "price". It matches
971
+ # The key for this facet. For example, `"colors"` or `"price"`. It matches
782
972
  # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
783
973
  # @!attribute [rw] values
784
974
  # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
@@ -808,7 +998,7 @@ module Google
808
998
  end
809
999
  end
810
1000
 
811
- # Summary of the top N search result specified by the summary spec.
1001
+ # Summary of the top N search results specified by the summary spec.
812
1002
  # @!attribute [rw] summary_text
813
1003
  # @return [::String]
814
1004
  # The summary content.
@@ -978,6 +1168,26 @@ module Google
978
1168
  include ::Google::Protobuf::MessageExts
979
1169
  extend ::Google::Protobuf::MessageExts::ClassMethods
980
1170
  end
1171
+
1172
+ # Information about the session.
1173
+ # @!attribute [rw] name
1174
+ # @return [::String]
1175
+ # Name of the session.
1176
+ # If the auto-session mode is used (when
1177
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session}
1178
+ # ends with "-"), this field holds the newly generated session name.
1179
+ # @!attribute [rw] query_id
1180
+ # @return [::String]
1181
+ # Query ID that corresponds to this search API call.
1182
+ # One session can have multiple turns, each with a unique query ID.
1183
+ #
1184
+ # By specifying the session name and this query ID in the Answer API call,
1185
+ # the answer generation happens in the context of the search results from
1186
+ # this search call.
1187
+ class SessionInfo
1188
+ include ::Google::Protobuf::MessageExts
1189
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1190
+ end
981
1191
  end
982
1192
  end
983
1193
  end
@@ -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
@@ -187,7 +208,7 @@ module Google
187
208
  # @return [::Array<::String>]
188
209
  # A list of identifiers for the independent experiment groups this user event
189
210
  # belongs to. This is used to distinguish between user events associated with
190
- # different experiment setups on the customer end.
211
+ # different experiment setups.
191
212
  # @!attribute [rw] promotion_ids
192
213
  # @return [::Array<::String>]
193
214
  # The promotion IDs if this is an event associated with promotions.
@@ -415,7 +436,7 @@ module Google
415
436
  # @return [::Integer]
416
437
  # Quantity of the Document associated with the user event. Defaults to 1.
417
438
  #
418
- # 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
419
440
  # are involved in a `add-to-cart` event.
420
441
  #
421
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