google-cloud-discovery_engine-v1beta 0.9.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +747 -1
  3. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/paths.rb +199 -0
  4. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +698 -1
  5. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +520 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/paths.rb +94 -0
  7. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +48 -23
  8. data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +21 -0
  9. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +48 -23
  10. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +296 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +275 -0
  12. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/service_stub.rb +180 -0
  13. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb +449 -0
  14. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/credentials.rb +47 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/paths.rb +52 -0
  16. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/client.rb +416 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/service_stub.rb +129 -0
  18. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest.rb +52 -0
  19. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service.rb +55 -0
  20. data/lib/google/cloud/discovery_engine/v1beta/rank_service/client.rb +459 -0
  21. data/lib/google/cloud/discovery_engine/v1beta/rank_service/credentials.rb +47 -0
  22. data/lib/google/cloud/discovery_engine/v1beta/rank_service/paths.rb +52 -0
  23. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/client.rb +426 -0
  24. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/service_stub.rb +129 -0
  25. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest.rb +52 -0
  26. data/lib/google/cloud/discovery_engine/v1beta/rank_service.rb +55 -0
  27. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +3 -0
  28. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +14 -7
  29. data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +45 -0
  30. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +14 -7
  31. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/client.rb +469 -0
  32. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/credentials.rb +47 -0
  33. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/operations.rb +801 -0
  34. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/paths.rb +78 -0
  35. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/client.rb +436 -0
  36. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +1077 -0
  37. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/service_stub.rb +129 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest.rb +53 -0
  39. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service.rb +56 -0
  40. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/client.rb +5 -4
  41. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/paths.rb +21 -0
  42. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/client.rb +5 -4
  43. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest.rb +2 -1
  44. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service.rb +2 -1
  45. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  46. data/lib/google/cloud/discovery_engine/v1beta.rb +3 -0
  47. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +67 -0
  48. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +1 -1
  49. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +32 -1
  50. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_services_pb.rb +25 -0
  51. data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +5 -1
  52. data/lib/google/cloud/discoveryengine/v1beta/document_pb.rb +3 -1
  53. data/lib/google/cloud/discoveryengine/v1beta/document_processing_config_pb.rb +48 -0
  54. data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +3 -1
  55. data/lib/google/cloud/discoveryengine/v1beta/engine_service_pb.rb +6 -1
  56. data/lib/google/cloud/discoveryengine/v1beta/engine_service_services_pb.rb +12 -0
  57. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_pb.rb +52 -0
  58. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_services_pb.rb +45 -0
  59. data/lib/google/cloud/discoveryengine/v1beta/grounding_pb.rb +46 -0
  60. data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +13 -1
  61. data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +1 -1
  62. data/lib/google/cloud/discoveryengine/v1beta/rank_service_pb.rb +49 -0
  63. data/lib/google/cloud/discoveryengine/v1beta/rank_service_services_pb.rb +45 -0
  64. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +8 -1
  65. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_pb.rb +57 -0
  66. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_services_pb.rb +45 -0
  67. data/lib/google/cloud/discoveryengine/v1beta/serving_config_service_pb.rb +1 -1
  68. data/lib/google/cloud/discoveryengine/v1beta/serving_config_service_services_pb.rb +2 -1
  69. data/lib/google/cloud/discoveryengine/v1beta/session_pb.rb +50 -0
  70. data/proto_docs/google/api/client.rb +4 -0
  71. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +354 -0
  72. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +9 -1
  73. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +480 -0
  74. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +20 -0
  75. data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +7 -0
  76. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +101 -0
  77. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +4 -0
  78. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +2 -2
  79. data/proto_docs/google/cloud/discoveryengine/v1beta/engine_service.rb +51 -0
  80. data/proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb +106 -0
  81. data/proto_docs/google/cloud/discoveryengine/v1beta/grounding.rb +76 -0
  82. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +310 -24
  83. data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +3 -0
  84. data/proto_docs/google/cloud/discoveryengine/v1beta/rank_service.rb +99 -0
  85. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +171 -26
  86. data/proto_docs/google/cloud/discoveryengine/v1beta/search_tuning_service.rb +141 -0
  87. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +4 -3
  88. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config_service.rb +3 -3
  89. data/proto_docs/google/cloud/discoveryengine/v1beta/session.rb +85 -0
  90. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +1 -1
  91. metadata +42 -2
@@ -131,6 +131,9 @@ module Google
131
131
 
132
132
  # The media industry vertical.
133
133
  MEDIA = 2
134
+
135
+ # The healthcare FHIR vertical.
136
+ HEALTHCARE_FHIR = 7
134
137
  end
135
138
 
136
139
  # The type of solution.
@@ -146,10 +149,15 @@ module Google
146
149
 
147
150
  # Used for use cases related to the Generative AI agent.
148
151
  SOLUTION_TYPE_CHAT = 3
152
+
153
+ # Used for use cases related to the Generative Chat agent.
154
+ # It's used for Generative chat engine only, the associated data stores
155
+ # must enrolled with `SOLUTION_TYPE_CHAT` solution.
156
+ SOLUTION_TYPE_GENERATIVE_CHAT = 4
149
157
  end
150
158
 
151
159
  # Tiers of search features. Different tiers might have different
152
- # pricing. To learn more, please check the pricing documentation.
160
+ # pricing. To learn more, check the pricing documentation.
153
161
  module SearchTier
154
162
  # Default value when the enum is unspecified. This is invalid to use.
155
163
  SEARCH_TIER_UNSPECIFIED = 0
@@ -88,6 +88,11 @@ module Google
88
88
  # For more information about filtering including syntax and filter
89
89
  # operators, see
90
90
  # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
91
+ # @!attribute [rw] boost_spec
92
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
93
+ # Boost specification to boost certain documents in search results which may
94
+ # affect the converse response. For more information on boosting, see
95
+ # [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
91
96
  class ConverseConversationRequest
92
97
  include ::Google::Protobuf::MessageExts
93
98
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -221,6 +226,481 @@ module Google
221
226
  include ::Google::Protobuf::MessageExts
222
227
  extend ::Google::Protobuf::MessageExts::ClassMethods
223
228
  end
229
+
230
+ # Request message for
231
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Client#answer_query ConversationalSearchService.AnswerQuery}
232
+ # method.
233
+ # @!attribute [rw] serving_config
234
+ # @return [::String]
235
+ # Required. The resource name of the Search serving config, such as
236
+ # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`,
237
+ # or
238
+ # `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`.
239
+ # This field is used to identify the serving configuration name, set
240
+ # of models used to make the search.
241
+ # @!attribute [rw] query
242
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Query]
243
+ # Required. Current user query.
244
+ # @!attribute [rw] session
245
+ # @return [::String]
246
+ # The session resource name. Not required.
247
+ #
248
+ # When session field is not set, the API is in sessionless mode.
249
+ #
250
+ # We support auto session mode: users can use the wildcard symbol “-” as
251
+ # session id. A new id will be automatically generated and assigned.
252
+ # @!attribute [rw] safety_spec
253
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SafetySpec]
254
+ # Model specification.
255
+ # @!attribute [rw] related_questions_spec
256
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::RelatedQuestionsSpec]
257
+ # Related questions specification.
258
+ # @!attribute [rw] answer_generation_spec
259
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::AnswerGenerationSpec]
260
+ # Answer generation specification.
261
+ # @!attribute [rw] search_spec
262
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec]
263
+ # Search specification.
264
+ # @!attribute [rw] query_understanding_spec
265
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::QueryUnderstandingSpec]
266
+ # Query understanding specification.
267
+ # @!attribute [rw] asynchronous_mode
268
+ # @return [::Boolean]
269
+ # Asynchronous mode control.
270
+ #
271
+ # If enabled, the response will be returned with answer/session resource
272
+ # name without final answer. The API users need to do the polling to get
273
+ # the latest status of answer/session by calling
274
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Client#get_answer ConversationalSearchService.GetAnswer}
275
+ # or
276
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Client#get_session ConversationalSearchService.GetSession}
277
+ # method.
278
+ # @!attribute [rw] user_pseudo_id
279
+ # @return [::String]
280
+ # A unique identifier for tracking visitors. For example, this could be
281
+ # implemented with an HTTP cookie, which should be able to uniquely identify
282
+ # a visitor on a single device. This unique identifier should not change if
283
+ # the visitor logs in or out of the website.
284
+ #
285
+ # This field should NOT have a fixed value such as `unknown_visitor`.
286
+ #
287
+ # The field must be a UTF-8 encoded string with a length limit of 128
288
+ # characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
289
+ class AnswerQueryRequest
290
+ include ::Google::Protobuf::MessageExts
291
+ extend ::Google::Protobuf::MessageExts::ClassMethods
292
+
293
+ # Safety specification.
294
+ # @!attribute [rw] enable
295
+ # @return [::Boolean]
296
+ # Enable the safety filtering on the answer response. It is false by
297
+ # default.
298
+ class SafetySpec
299
+ include ::Google::Protobuf::MessageExts
300
+ extend ::Google::Protobuf::MessageExts::ClassMethods
301
+ end
302
+
303
+ # Related questions specification.
304
+ # @!attribute [rw] enable
305
+ # @return [::Boolean]
306
+ # Enable related questions feature if true.
307
+ class RelatedQuestionsSpec
308
+ include ::Google::Protobuf::MessageExts
309
+ extend ::Google::Protobuf::MessageExts::ClassMethods
310
+ end
311
+
312
+ # Answer generation specification.
313
+ # @!attribute [rw] model_spec
314
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec]
315
+ # Answer generation model specification.
316
+ # @!attribute [rw] prompt_spec
317
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec]
318
+ # Answer generation prompt specification.
319
+ # @!attribute [rw] include_citations
320
+ # @return [::Boolean]
321
+ # Specifies whether to include citation metadata in the answer. The default
322
+ # value is `false`.
323
+ # @!attribute [rw] answer_language_code
324
+ # @return [::String]
325
+ # Language code for Answer. Use language tags defined by
326
+ # [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
327
+ # Note: This is an experimental feature.
328
+ # @!attribute [rw] ignore_adversarial_query
329
+ # @return [::Boolean]
330
+ # Specifies whether to filter out adversarial queries. The default value
331
+ # is `false`.
332
+ #
333
+ # Google employs search-query classification to detect adversarial
334
+ # queries. No answer is returned if the search query is classified as an
335
+ # adversarial query. For example, a user might ask a question regarding
336
+ # negative comments about the company or submit a query designed to
337
+ # generate unsafe, policy-violating output. If this field is set to
338
+ # `true`, we skip generating answers for adversarial queries and return
339
+ # fallback messages instead.
340
+ # @!attribute [rw] ignore_non_answer_seeking_query
341
+ # @return [::Boolean]
342
+ # Specifies whether to filter out queries that are not answer-seeking.
343
+ # The default value is `false`.
344
+ #
345
+ # Google employs search-query classification to detect answer-seeking
346
+ # queries. No answer is returned if the search query is classified as a
347
+ # non-answer seeking query. If this field is set to `true`, we skip
348
+ # generating answers for non-answer seeking queries and return
349
+ # fallback messages instead.
350
+ class AnswerGenerationSpec
351
+ include ::Google::Protobuf::MessageExts
352
+ extend ::Google::Protobuf::MessageExts::ClassMethods
353
+
354
+ # Answer Generation Model specification.
355
+ # @!attribute [rw] model_version
356
+ # @return [::String]
357
+ # Model version. If not set, it will use the default stable model.
358
+ # Allowed values are: stable, preview.
359
+ class ModelSpec
360
+ include ::Google::Protobuf::MessageExts
361
+ extend ::Google::Protobuf::MessageExts::ClassMethods
362
+ end
363
+
364
+ # Answer generation prompt specification.
365
+ # @!attribute [rw] preamble
366
+ # @return [::String]
367
+ # Customized preamble.
368
+ class PromptSpec
369
+ include ::Google::Protobuf::MessageExts
370
+ extend ::Google::Protobuf::MessageExts::ClassMethods
371
+ end
372
+ end
373
+
374
+ # Search specification.
375
+ # @!attribute [rw] search_params
376
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec::SearchParams]
377
+ # Search parameters.
378
+ # @!attribute [rw] search_result_list
379
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec::SearchResultList]
380
+ # Search result list.
381
+ class SearchSpec
382
+ include ::Google::Protobuf::MessageExts
383
+ extend ::Google::Protobuf::MessageExts::ClassMethods
384
+
385
+ # Search parameters.
386
+ # @!attribute [rw] max_return_results
387
+ # @return [::Integer]
388
+ # Number of search results to return.
389
+ # The default value is 10.
390
+ # @!attribute [rw] filter
391
+ # @return [::String]
392
+ # The filter syntax consists of an expression language for constructing
393
+ # a predicate from one or more fields of the documents being filtered.
394
+ # Filter expression is case-sensitive. This will be used to filter
395
+ # search results which may affect the Answer response.
396
+ #
397
+ # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
398
+ #
399
+ # Filtering in Vertex AI Search is done by mapping the LHS filter key
400
+ # to a key property defined in the Vertex AI Search backend -- this
401
+ # mapping is defined by the customer in their schema. For example a
402
+ # media customers might have a field 'name' in their schema. In this
403
+ # case the filter would look like this: filter --> name:'ANY("king
404
+ # kong")'
405
+ #
406
+ # For more information about filtering including syntax and filter
407
+ # operators, see
408
+ # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
409
+ # @!attribute [rw] boost_spec
410
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
411
+ # Boost specification to boost certain documents in search results which
412
+ # may affect the answer query response. For more information on boosting,
413
+ # see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
414
+ # @!attribute [rw] order_by
415
+ # @return [::String]
416
+ # The order in which documents are returned. Documents can be ordered
417
+ # by a field in an
418
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Leave
419
+ # it unset if ordered by relevance. `order_by` expression is
420
+ # case-sensitive. For more information on ordering, see
421
+ # [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
422
+ #
423
+ # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
424
+ class SearchParams
425
+ include ::Google::Protobuf::MessageExts
426
+ extend ::Google::Protobuf::MessageExts::ClassMethods
427
+ end
428
+
429
+ # Search result list.
430
+ # @!attribute [rw] search_results
431
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
432
+ # Search results.
433
+ class SearchResultList
434
+ include ::Google::Protobuf::MessageExts
435
+ extend ::Google::Protobuf::MessageExts::ClassMethods
436
+
437
+ # Search result.
438
+ # @!attribute [rw] unstructured_document_info
439
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
440
+ # Unstructured document information.
441
+ # @!attribute [rw] chunk_info
442
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
443
+ # Chunk information.
444
+ class SearchResult
445
+ include ::Google::Protobuf::MessageExts
446
+ extend ::Google::Protobuf::MessageExts::ClassMethods
447
+
448
+ # Unstructured document information.
449
+ # @!attribute [rw] document
450
+ # @return [::String]
451
+ # Document resource name.
452
+ # @!attribute [rw] uri
453
+ # @return [::String]
454
+ # URI for the document.
455
+ # @!attribute [rw] title
456
+ # @return [::String]
457
+ # Title.
458
+ # @!attribute [rw] document_contexts
459
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
460
+ # List of document contexts.
461
+ # @!attribute [rw] extractive_segments
462
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
463
+ # List of extractive segments.
464
+ # @!attribute [rw] extractive_answers
465
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
466
+ # List of extractive answers.
467
+ class UnstructuredDocumentInfo
468
+ include ::Google::Protobuf::MessageExts
469
+ extend ::Google::Protobuf::MessageExts::ClassMethods
470
+
471
+ # Document context.
472
+ # @!attribute [rw] page_identifier
473
+ # @return [::String]
474
+ # Page identifier.
475
+ # @!attribute [rw] content
476
+ # @return [::String]
477
+ # Document content.
478
+ class DocumentContext
479
+ include ::Google::Protobuf::MessageExts
480
+ extend ::Google::Protobuf::MessageExts::ClassMethods
481
+ end
482
+
483
+ # Extractive segment.
484
+ # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
485
+ # @!attribute [rw] page_identifier
486
+ # @return [::String]
487
+ # Page identifier.
488
+ # @!attribute [rw] content
489
+ # @return [::String]
490
+ # Extractive segment content.
491
+ class ExtractiveSegment
492
+ include ::Google::Protobuf::MessageExts
493
+ extend ::Google::Protobuf::MessageExts::ClassMethods
494
+ end
495
+
496
+ # Extractive answer.
497
+ # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
498
+ # @!attribute [rw] page_identifier
499
+ # @return [::String]
500
+ # Page identifier.
501
+ # @!attribute [rw] content
502
+ # @return [::String]
503
+ # Extractive answer content.
504
+ class ExtractiveAnswer
505
+ include ::Google::Protobuf::MessageExts
506
+ extend ::Google::Protobuf::MessageExts::ClassMethods
507
+ end
508
+ end
509
+
510
+ # Chunk information.
511
+ # @!attribute [rw] chunk
512
+ # @return [::String]
513
+ # Chunk resource name.
514
+ # @!attribute [rw] content
515
+ # @return [::String]
516
+ # Chunk textual content.
517
+ class ChunkInfo
518
+ include ::Google::Protobuf::MessageExts
519
+ extend ::Google::Protobuf::MessageExts::ClassMethods
520
+ end
521
+ end
522
+ end
523
+ end
524
+
525
+ # Query understanding specification.
526
+ # @!attribute [rw] query_classification_spec
527
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec]
528
+ # Query classification specification.
529
+ # @!attribute [rw] query_rephraser_spec
530
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec]
531
+ # Query rephraser specification.
532
+ class QueryUnderstandingSpec
533
+ include ::Google::Protobuf::MessageExts
534
+ extend ::Google::Protobuf::MessageExts::ClassMethods
535
+
536
+ # Query classification specification.
537
+ # @!attribute [rw] types
538
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>]
539
+ # Enabled query classification types.
540
+ class QueryClassificationSpec
541
+ include ::Google::Protobuf::MessageExts
542
+ extend ::Google::Protobuf::MessageExts::ClassMethods
543
+
544
+ # Query classification types.
545
+ module Type
546
+ # Unspecified query classification type.
547
+ TYPE_UNSPECIFIED = 0
548
+
549
+ # Adversarial query classification type.
550
+ ADVERSARIAL_QUERY = 1
551
+
552
+ # Non-answer-seeking query classification type.
553
+ NON_ANSWER_SEEKING_QUERY = 2
554
+ end
555
+ end
556
+
557
+ # Query rephraser specification.
558
+ # @!attribute [rw] disable
559
+ # @return [::Boolean]
560
+ # Disable query rephraser.
561
+ # @!attribute [rw] max_rephrase_steps
562
+ # @return [::Integer]
563
+ # Max rephrase steps.
564
+ # The max number is 10 steps.
565
+ # If not set or set to < 1, it will be set to 1 by default.
566
+ class QueryRephraserSpec
567
+ include ::Google::Protobuf::MessageExts
568
+ extend ::Google::Protobuf::MessageExts::ClassMethods
569
+ end
570
+ end
571
+ end
572
+
573
+ # Response message for
574
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Client#answer_query ConversationalSearchService.AnswerQuery}
575
+ # method.
576
+ # @!attribute [rw] answer
577
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Answer]
578
+ # Answer resource object.
579
+ # If [AnswerQueryRequest.StepSpec.max_step_count][] is greater than 1,
580
+ # use {::Google::Cloud::DiscoveryEngine::V1beta::Answer#name Answer.name} to fetch
581
+ # answer information using
582
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Client#get_answer ConversationalSearchService.GetAnswer}
583
+ # API.
584
+ # @!attribute [rw] session
585
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Session]
586
+ # Session resource object.
587
+ # It will be only available when session field is set and valid in the
588
+ # {::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest AnswerQueryRequest}
589
+ # request.
590
+ class AnswerQueryResponse
591
+ include ::Google::Protobuf::MessageExts
592
+ extend ::Google::Protobuf::MessageExts::ClassMethods
593
+ end
594
+
595
+ # Request for GetAnswer method.
596
+ # @!attribute [rw] name
597
+ # @return [::String]
598
+ # Required. The resource name of the Answer to get. Format:
599
+ # `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
600
+ class GetAnswerRequest
601
+ include ::Google::Protobuf::MessageExts
602
+ extend ::Google::Protobuf::MessageExts::ClassMethods
603
+ end
604
+
605
+ # Request for CreateSession method.
606
+ # @!attribute [rw] parent
607
+ # @return [::String]
608
+ # Required. Full resource name of parent data store. Format:
609
+ # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
610
+ # @!attribute [rw] session
611
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Session]
612
+ # Required. The session to create.
613
+ class CreateSessionRequest
614
+ include ::Google::Protobuf::MessageExts
615
+ extend ::Google::Protobuf::MessageExts::ClassMethods
616
+ end
617
+
618
+ # Request for UpdateSession method.
619
+ # @!attribute [rw] session
620
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Session]
621
+ # Required. The Session to update.
622
+ # @!attribute [rw] update_mask
623
+ # @return [::Google::Protobuf::FieldMask]
624
+ # Indicates which fields in the provided
625
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Session Session} to update. The
626
+ # following are NOT supported:
627
+ #
628
+ # * {::Google::Cloud::DiscoveryEngine::V1beta::Session#name Session.name}
629
+ #
630
+ # If not set or empty, all supported fields are updated.
631
+ class UpdateSessionRequest
632
+ include ::Google::Protobuf::MessageExts
633
+ extend ::Google::Protobuf::MessageExts::ClassMethods
634
+ end
635
+
636
+ # Request for DeleteSession method.
637
+ # @!attribute [rw] name
638
+ # @return [::String]
639
+ # Required. The resource name of the Session to delete. Format:
640
+ # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
641
+ class DeleteSessionRequest
642
+ include ::Google::Protobuf::MessageExts
643
+ extend ::Google::Protobuf::MessageExts::ClassMethods
644
+ end
645
+
646
+ # Request for GetSession method.
647
+ # @!attribute [rw] name
648
+ # @return [::String]
649
+ # Required. The resource name of the Session to get. Format:
650
+ # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
651
+ class GetSessionRequest
652
+ include ::Google::Protobuf::MessageExts
653
+ extend ::Google::Protobuf::MessageExts::ClassMethods
654
+ end
655
+
656
+ # Request for ListSessions method.
657
+ # @!attribute [rw] parent
658
+ # @return [::String]
659
+ # Required. The data store resource name. Format:
660
+ # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
661
+ # @!attribute [rw] page_size
662
+ # @return [::Integer]
663
+ # Maximum number of results to return. If unspecified, defaults
664
+ # to 50. Max allowed value is 1000.
665
+ # @!attribute [rw] page_token
666
+ # @return [::String]
667
+ # A page token, received from a previous `ListSessions` call.
668
+ # Provide this to retrieve the subsequent page.
669
+ # @!attribute [rw] filter
670
+ # @return [::String]
671
+ # A filter to apply on the list results. The supported features are:
672
+ # user_pseudo_id, state.
673
+ #
674
+ # Example:
675
+ # "user_pseudo_id = some_id"
676
+ # @!attribute [rw] order_by
677
+ # @return [::String]
678
+ # A comma-separated list of fields to order by, sorted in ascending order.
679
+ # Use "desc" after a field name for descending.
680
+ # Supported fields:
681
+ # * `update_time`
682
+ # * `create_time`
683
+ # * `session_name`
684
+ #
685
+ # Example:
686
+ # "update_time desc"
687
+ # "create_time"
688
+ class ListSessionsRequest
689
+ include ::Google::Protobuf::MessageExts
690
+ extend ::Google::Protobuf::MessageExts::ClassMethods
691
+ end
692
+
693
+ # Response for ListSessions method.
694
+ # @!attribute [rw] sessions
695
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Session>]
696
+ # All the Sessions for a given data store.
697
+ # @!attribute [rw] next_page_token
698
+ # @return [::String]
699
+ # Pagination token, if not returned indicates the last page.
700
+ class ListSessionsResponse
701
+ include ::Google::Protobuf::MessageExts
702
+ extend ::Google::Protobuf::MessageExts::ClassMethods
703
+ end
224
704
  end
225
705
  end
226
706
  end
@@ -61,6 +61,26 @@ module Google
61
61
  # @return [::Google::Protobuf::Timestamp]
62
62
  # Output only. Timestamp the
63
63
  # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} was created at.
64
+ # @!attribute [rw] document_processing_config
65
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig]
66
+ # Configuration for Document understanding and enrichment.
67
+ # @!attribute [rw] starting_schema
68
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Schema]
69
+ # The start schema to use for this
70
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} when
71
+ # provisioning it. If unset, a default vertical specialized schema will be
72
+ # used.
73
+ #
74
+ # This field is only used by [CreateDataStore][] API, and will be ignored if
75
+ # used in other APIs. This field will be omitted from all API responses
76
+ # including [CreateDataStore][] API. To retrieve a schema of a
77
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, use
78
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Client#get_schema SchemaService.GetSchema}
79
+ # API instead.
80
+ #
81
+ # The provided schema will be validated against certain rules on schema.
82
+ # Learn more from [this
83
+ # doc](https://cloud.google.com/generative-ai-app-builder/docs/provide-schema).
64
84
  class DataStore
65
85
  include ::Google::Protobuf::MessageExts
66
86
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -66,6 +66,13 @@ module Google
66
66
  # @return [::Google::Protobuf::Struct]
67
67
  # Output only. This field is OUTPUT_ONLY.
68
68
  # It contains derived data that are not in the original input document.
69
+ # @!attribute [r] index_time
70
+ # @return [::Google::Protobuf::Timestamp]
71
+ # Output only. The last time the document was indexed. If this field is set,
72
+ # the document could be returned in search results.
73
+ #
74
+ # This field is OUTPUT_ONLY. If this field is not populated, it means the
75
+ # document has never been indexed.
69
76
  class Document
70
77
  include ::Google::Protobuf::MessageExts
71
78
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -0,0 +1,101 @@
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 V1beta
24
+ # A singleton resource of
25
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}. It's empty when
26
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is created, which
27
+ # defaults to digital parser. The first call to
28
+ # [DataStoreService.UpdateDocumentProcessingConfig][] method will initialize
29
+ # the config.
30
+ # @!attribute [rw] name
31
+ # @return [::String]
32
+ # The full resource name of the Document Processing Config.
33
+ # Format:
34
+ # `projects/*/locations/*/collections/*/dataStores/*/documentProcessingConfig`.
35
+ # @!attribute [rw] default_parsing_config
36
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig::ParsingConfig]
37
+ # Configurations for default Document parser.
38
+ # If not specified, we will configure it as default DigitalParsingConfig, and
39
+ # the default parsing config will be applied to all file types for Document
40
+ # parsing.
41
+ # @!attribute [rw] parsing_config_overrides
42
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig::ParsingConfig}]
43
+ # Map from file type to override the default parsing configuration based on
44
+ # the file type. Supported keys:
45
+ # * `pdf`: Override parsing config for PDF files, either digital parsing, ocr
46
+ # parsing or layout parsing is supported.
47
+ # * `html`: Override parsing config for HTML files, only digital parsing and
48
+ # or layout parsing are supported.
49
+ # * `docx`: Override parsing config for DOCX files, only digital parsing and
50
+ # or layout parsing are supported.
51
+ class DocumentProcessingConfig
52
+ include ::Google::Protobuf::MessageExts
53
+ extend ::Google::Protobuf::MessageExts::ClassMethods
54
+
55
+ # Related configurations applied to a specific type of document parser.
56
+ # @!attribute [rw] digital_parsing_config
57
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig::ParsingConfig::DigitalParsingConfig]
58
+ # Configurations applied to digital parser.
59
+ # @!attribute [rw] ocr_parsing_config
60
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig::ParsingConfig::OcrParsingConfig]
61
+ # Configurations applied to OCR parser. Currently it only applies to
62
+ # PDFs.
63
+ class ParsingConfig
64
+ include ::Google::Protobuf::MessageExts
65
+ extend ::Google::Protobuf::MessageExts::ClassMethods
66
+
67
+ # The digital parsing configurations for documents.
68
+ class DigitalParsingConfig
69
+ include ::Google::Protobuf::MessageExts
70
+ extend ::Google::Protobuf::MessageExts::ClassMethods
71
+ end
72
+
73
+ # The OCR parsing configurations for documents.
74
+ # @!attribute [rw] enhanced_document_elements
75
+ # @deprecated This field is deprecated and may be removed in the next major version update.
76
+ # @return [::Array<::String>]
77
+ # [DEPRECATED] This field is deprecated. To use the additional enhanced
78
+ # document elements processing, please switch to `layout_parsing_config`.
79
+ # @!attribute [rw] use_native_text
80
+ # @return [::Boolean]
81
+ # If true, will use native text instead of OCR text on pages containing
82
+ # native text.
83
+ class OcrParsingConfig
84
+ include ::Google::Protobuf::MessageExts
85
+ extend ::Google::Protobuf::MessageExts::ClassMethods
86
+ end
87
+ end
88
+
89
+ # @!attribute [rw] key
90
+ # @return [::String]
91
+ # @!attribute [rw] value
92
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig::ParsingConfig]
93
+ class ParsingConfigOverridesEntry
94
+ include ::Google::Protobuf::MessageExts
95
+ extend ::Google::Protobuf::MessageExts::ClassMethods
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
@@ -152,6 +152,10 @@ module Google
152
152
  # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} is not found, a
153
153
  # new {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} will be
154
154
  # created.
155
+ # @!attribute [rw] update_mask
156
+ # @return [::Google::Protobuf::FieldMask]
157
+ # Indicates which fields in the provided imported 'document' to update. If
158
+ # not set, will by default update all fields.
155
159
  class UpdateDocumentRequest
156
160
  include ::Google::Protobuf::MessageExts
157
161
  extend ::Google::Protobuf::MessageExts::ClassMethods