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
@@ -0,0 +1,99 @@
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
+ # Record message for
25
+ # {::Google::Cloud::DiscoveryEngine::V1beta::RankService::Client#rank RankService.Rank}
26
+ # method.
27
+ # @!attribute [rw] id
28
+ # @return [::String]
29
+ # The unique ID to represent the record.
30
+ # @!attribute [rw] title
31
+ # @return [::String]
32
+ # The title of the record. Empty by default.
33
+ # At least one of
34
+ # {::Google::Cloud::DiscoveryEngine::V1beta::RankingRecord#title title} or
35
+ # {::Google::Cloud::DiscoveryEngine::V1beta::RankingRecord#content content} should
36
+ # be set otherwise an INVALID_ARGUMENT error is thrown.
37
+ # @!attribute [rw] content
38
+ # @return [::String]
39
+ # The content of the record. Empty by default.
40
+ # At least one of
41
+ # {::Google::Cloud::DiscoveryEngine::V1beta::RankingRecord#title title} or
42
+ # {::Google::Cloud::DiscoveryEngine::V1beta::RankingRecord#content content} should
43
+ # be set otherwise an INVALID_ARGUMENT error is thrown.
44
+ # @!attribute [rw] score
45
+ # @return [::Float]
46
+ # The score of this record based on the given query and selected model.
47
+ class RankingRecord
48
+ include ::Google::Protobuf::MessageExts
49
+ extend ::Google::Protobuf::MessageExts::ClassMethods
50
+ end
51
+
52
+ # Request message for
53
+ # {::Google::Cloud::DiscoveryEngine::V1beta::RankService::Client#rank RankService.Rank}
54
+ # method.
55
+ # @!attribute [rw] ranking_config
56
+ # @return [::String]
57
+ # Required. The resource name of the rank service config, such as
58
+ # `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`.
59
+ # @!attribute [rw] model
60
+ # @return [::String]
61
+ # The identifier of the model to use. It is one of:
62
+ #
63
+ # * `semantic-ranker-512@latest`: Semantic ranking model with maxiumn input
64
+ # token size 512.
65
+ #
66
+ # It is set to `semantic-ranker-512@latest` by default if unspecified.
67
+ # @!attribute [rw] top_n
68
+ # @return [::Integer]
69
+ # The number of results to return. If this is unset or no bigger than zero,
70
+ # returns all results.
71
+ # @!attribute [rw] query
72
+ # @return [::String]
73
+ # The query to use.
74
+ # @!attribute [rw] records
75
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::RankingRecord>]
76
+ # Required. A list of records to rank. At most 200 records to rank.
77
+ # @!attribute [rw] ignore_record_details_in_response
78
+ # @return [::Boolean]
79
+ # If true, the response will contain only record ID and score. By default, it
80
+ # is false, the response will contain record details.
81
+ class RankRequest
82
+ include ::Google::Protobuf::MessageExts
83
+ extend ::Google::Protobuf::MessageExts::ClassMethods
84
+ end
85
+
86
+ # Response message for
87
+ # {::Google::Cloud::DiscoveryEngine::V1beta::RankService::Client#rank RankService.Rank}
88
+ # method.
89
+ # @!attribute [rw] records
90
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::RankingRecord>]
91
+ # A list of records sorted by descending score.
92
+ class RankResponse
93
+ include ::Google::Protobuf::MessageExts
94
+ extend ::Google::Protobuf::MessageExts::ClassMethods
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
@@ -48,10 +48,14 @@ module Google
48
48
  # @!attribute [rw] page_size
49
49
  # @return [::Integer]
50
50
  # Maximum number of {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s
51
- # to return. If unspecified, defaults to a reasonable value. The maximum
52
- # allowed value is 100. Values above 100 are coerced to 100.
51
+ # to 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,9 @@ module Google
72
76
  # is 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::V1beta::SearchRequest::DataStoreSpec>]
81
+ # A list of data store specs to apply on a search call.
75
82
  # @!attribute [rw] filter
76
83
  # @return [::String]
77
84
  # The filter syntax consists of an expression language for constructing a
@@ -185,7 +192,8 @@ module Google
185
192
  #
186
193
  # If
187
194
  # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector#field_path SearchRequest.EmbeddingSpec.EmbeddingVector.field_path}
188
- # is not provided, it will use [ServingConfig.EmbeddingConfig.field_path][].
195
+ # is not provided, it will use
196
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig#embedding_config ServingConfig.EmbeddingConfig.field_path}.
189
197
  # @!attribute [rw] ranking_expression
190
198
  # @return [::String]
191
199
  # The ranking expression controls the customized ranking on retrieval
@@ -245,6 +253,17 @@ module Google
245
253
  extend ::Google::Protobuf::MessageExts::ClassMethods
246
254
  end
247
255
 
256
+ # A struct to define data stores to filter on in a search call.
257
+ # @!attribute [rw] data_store
258
+ # @return [::String]
259
+ # Required. Full resource name of
260
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
261
+ # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
262
+ class DataStoreSpec
263
+ include ::Google::Protobuf::MessageExts
264
+ extend ::Google::Protobuf::MessageExts::ClassMethods
265
+ end
266
+
248
267
  # A facet specification to perform faceted search.
249
268
  # @!attribute [rw] facet_key
250
269
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
@@ -404,31 +423,116 @@ module Google
404
423
  # Examples:
405
424
  #
406
425
  # * To boost documents with document ID "doc_1" or "doc_2", and
407
- # color
408
- # "Red" or "Blue":
409
- # * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
426
+ # color "Red" or "Blue":
427
+ # `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
410
428
  # @!attribute [rw] boost
411
429
  # @return [::Float]
412
430
  # Strength of the condition boost, which should be in [-1, 1]. Negative
413
431
  # boost means demotion. Default is 0.0.
414
432
  #
415
- # Setting to 1.0 gives the document a big promotion. However, it does not
416
- # necessarily mean that the boosted document will be the top result at
417
- # all times, nor that other documents will be excluded. Results could
418
- # still be shown even when none of them matches the condition. And
419
- # results that are significantly more relevant to the search query can
420
- # still trump your heavily favored but irrelevant documents.
433
+ # Setting to 1.0 gives the document a big promotion. However, it does
434
+ # not necessarily mean that the boosted document will be the top result
435
+ # at all times, nor that other documents will be excluded. Results
436
+ # could still be shown even when none of them matches the condition.
437
+ # And results that are significantly more relevant to the search query
438
+ # can still trump your heavily favored but irrelevant documents.
421
439
  #
422
440
  # Setting to -1.0 gives the document a big demotion. However, results
423
441
  # that are deeply relevant might still be shown. The document will have
424
- # an upstream battle to get a fairly high ranking, but it is not blocked
425
- # out completely.
442
+ # an upstream battle to get a fairly high ranking, but it is not
443
+ # blocked out completely.
426
444
  #
427
445
  # Setting to 0.0 means no boost applied. The boosting condition is
428
- # ignored.
446
+ # ignored. Only one of the (condition, boost) combination or the
447
+ # boost_control_spec below are set. If both are set then the global boost
448
+ # is ignored and the more fine-grained boost_control_spec is applied.
449
+ # @!attribute [rw] boost_control_spec
450
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
451
+ # Complex specification for custom ranking based on customer defined
452
+ # attribute value.
429
453
  class ConditionBoostSpec
430
454
  include ::Google::Protobuf::MessageExts
431
455
  extend ::Google::Protobuf::MessageExts::ClassMethods
456
+
457
+ # Specification for custom ranking based on customer specified attribute
458
+ # value. It provides more controls for customized ranking than the simple
459
+ # (condition, boost) combination above.
460
+ # @!attribute [rw] field_name
461
+ # @return [::String]
462
+ # The name of the field whose value will be used to determine the
463
+ # boost amount.
464
+ # @!attribute [rw] attribute_type
465
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
466
+ # The attribute type to be used to determine the boost amount. The
467
+ # attribute value can be derived from the field value of the specified
468
+ # field_name. In the case of numerical it is straightforward i.e.
469
+ # attribute_value = numerical_field_value. In the case of freshness
470
+ # however, attribute_value = (time.now() - datetime_field_value).
471
+ # @!attribute [rw] interpolation_type
472
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
473
+ # The interpolation type to be applied to connect the control points
474
+ # listed below.
475
+ # @!attribute [rw] control_points
476
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
477
+ # The control points used to define the curve. The monotonic function
478
+ # (defined through the interpolation_type above) passes through the
479
+ # control points listed here.
480
+ class BoostControlSpec
481
+ include ::Google::Protobuf::MessageExts
482
+ extend ::Google::Protobuf::MessageExts::ClassMethods
483
+
484
+ # The control points used to define the curve. The curve defined
485
+ # through these control points can only be monotonically increasing
486
+ # or decreasing(constant values are acceptable).
487
+ # @!attribute [rw] attribute_value
488
+ # @return [::String]
489
+ # Can be one of:
490
+ # 1. The numerical field value.
491
+ # 2. The duration spec for freshness:
492
+ # The value must be formatted as an XSD `dayTimeDuration` value (a
493
+ # restricted subset of an ISO 8601 duration value). The pattern for
494
+ # this is: `[nD][T[nH][nM][nS]]`.
495
+ # @!attribute [rw] boost_amount
496
+ # @return [::Float]
497
+ # The value between -1 to 1 by which to boost the score if the
498
+ # attribute_value evaluates to the value specified above.
499
+ class ControlPoint
500
+ include ::Google::Protobuf::MessageExts
501
+ extend ::Google::Protobuf::MessageExts::ClassMethods
502
+ end
503
+
504
+ # The attribute(or function) for which the custom ranking is to be
505
+ # applied.
506
+ module AttributeType
507
+ # Unspecified AttributeType.
508
+ ATTRIBUTE_TYPE_UNSPECIFIED = 0
509
+
510
+ # The value of the numerical field will be used to dynamically update
511
+ # the boost amount. In this case, the attribute_value (the x value)
512
+ # of the control point will be the actual value of the numerical
513
+ # field for which the boost_amount is specified.
514
+ NUMERICAL = 1
515
+
516
+ # For the freshness use case the attribute value will be the duration
517
+ # between the current time and the date in the datetime field
518
+ # specified. The value must be formatted as an XSD `dayTimeDuration`
519
+ # value (a restricted subset of an ISO 8601 duration value). The
520
+ # pattern for this is: `[nD][T[nH][nM][nS]]`.
521
+ # E.g. `5D`, `3DT12H30M`, `T24H`.
522
+ FRESHNESS = 2
523
+ end
524
+
525
+ # The interpolation type to be applied. Default will be linear
526
+ # (Piecewise Linear).
527
+ module InterpolationType
528
+ # Interpolation type is unspecified. In this case, it defaults to
529
+ # Linear.
530
+ INTERPOLATION_TYPE_UNSPECIFIED = 0
531
+
532
+ # Piecewise linear interpolation will be applied.
533
+ LINEAR = 1
534
+ end
535
+ end
432
536
  end
433
537
  end
434
538
 
@@ -540,7 +644,7 @@ module Google
540
644
  # of results returned is less than `summaryResultCount`, the summary is
541
645
  # generated from all of the results.
542
646
  #
543
- # At most five results can be used to generate a summary.
647
+ # At most 10 results can be used to generate a summary.
544
648
  # @!attribute [rw] include_citations
545
649
  # @return [::Boolean]
546
650
  # Specifies whether to include citations in the summary. The default
@@ -598,6 +702,14 @@ module Google
598
702
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
599
703
  # If specified, the spec will be used to modify the model specification
600
704
  # provided to the LLM.
705
+ # @!attribute [rw] use_semantic_chunks
706
+ # @return [::Boolean]
707
+ # If true, answer will be generated from most relevant chunks from top
708
+ # search results. This feature will improve summary quality.
709
+ # Note that with this feature enabled, not all top search results
710
+ # will be referenced and included in the reference list, so the citation
711
+ # source index only points to the search results listed in the reference
712
+ # list.
601
713
  class SummarySpec
602
714
  include ::Google::Protobuf::MessageExts
603
715
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -620,11 +732,13 @@ module Google
620
732
  # Supported values are:
621
733
  #
622
734
  # * `stable`: string. Default value when no value is specified. Uses a
623
- # generally available, fine-tuned version of the text-bison@001
624
- # model.
625
- # * `preview`: string. (Public preview) Uses a fine-tuned version of
626
- # the text-bison@002 model. This model works only for summaries in
627
- # English.
735
+ # generally available, fine-tuned model. For more information, see
736
+ # [Answer generation model versions and
737
+ # lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
738
+ # * `preview`: string. (Public preview) Uses a preview model. For more
739
+ # information, see
740
+ # [Answer generation model versions and
741
+ # lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
628
742
  class ModelSpec
629
743
  include ::Google::Protobuf::MessageExts
630
744
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -670,10 +784,9 @@ module Google
670
784
  # @!attribute [rw] return_extractive_segment_score
671
785
  # @return [::Boolean]
672
786
  # Specifies whether to return the confidence score from the extractive
673
- # segments in each search result. The default value is `false`.
674
- #
675
- # Note: this is a priavte preview feature and only works for allowlisted
676
- # users, please reach out to Cloud Support team if you want to use it.
787
+ # segments in each search result. This feature is available only for new
788
+ # or allowlisted data stores. To allowlist your data store,
789
+ # contact your Customer Engineer. The default value is `false`.
677
790
  # @!attribute [rw] num_previous_segments
678
791
  # @return [::Integer]
679
792
  # Specifies whether to also include the adjacent from each selected
@@ -785,6 +898,10 @@ module Google
785
898
  # @!attribute [rw] applied_controls
786
899
  # @return [::Array<::String>]
787
900
  # Controls applied as part of the Control service.
901
+ # @!attribute [rw] geo_search_debug_info
902
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::GeoSearchDebugInfo>]
903
+ # Debug information specifically related to forward geocoding issues arising
904
+ # from Geolocation Search.
788
905
  # @!attribute [rw] query_expansion_info
789
906
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::QueryExpansionInfo]
790
907
  # Query expansion information for the returned results.
@@ -958,9 +1075,24 @@ module Google
958
1075
  # @!attribute [rw] uri
959
1076
  # @return [::String]
960
1077
  # Cloud Storage or HTTP uri for the document.
1078
+ # @!attribute [rw] chunk_contents
1079
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Summary::Reference::ChunkContent>]
1080
+ # List of cited chunk contents derived from document content.
961
1081
  class Reference
962
1082
  include ::Google::Protobuf::MessageExts
963
1083
  extend ::Google::Protobuf::MessageExts::ClassMethods
1084
+
1085
+ # Chunk content.
1086
+ # @!attribute [rw] content
1087
+ # @return [::String]
1088
+ # Chunk textual content.
1089
+ # @!attribute [rw] page_identifier
1090
+ # @return [::String]
1091
+ # Page identifier.
1092
+ class ChunkContent
1093
+ include ::Google::Protobuf::MessageExts
1094
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1095
+ end
964
1096
  end
965
1097
 
966
1098
  # Summary with metadata information.
@@ -1017,6 +1149,19 @@ module Google
1017
1149
  end
1018
1150
  end
1019
1151
 
1152
+ # Debug information specifically related to forward geocoding issues arising
1153
+ # from Geolocation Search.
1154
+ # @!attribute [rw] original_address_query
1155
+ # @return [::String]
1156
+ # The address from which forward geocoding ingestion produced issues.
1157
+ # @!attribute [rw] error_message
1158
+ # @return [::String]
1159
+ # The error produced.
1160
+ class GeoSearchDebugInfo
1161
+ include ::Google::Protobuf::MessageExts
1162
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1163
+ end
1164
+
1020
1165
  # Information describing query expansion including whether expansion has
1021
1166
  # occurred.
1022
1167
  # @!attribute [rw] expanded_query
@@ -0,0 +1,141 @@
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
+ # Request message for
25
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Client#train_custom_model SearchTuningService.TrainCustomModel}
26
+ # method.
27
+ # @!attribute [rw] gcs_training_input
28
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::TrainCustomModelRequest::GcsTrainingInput]
29
+ # Cloud Storage training input.
30
+ # @!attribute [rw] data_store
31
+ # @return [::String]
32
+ # Required. The resource name of the Data Store, such as
33
+ # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
34
+ # This field is used to identify the data store where to train the models.
35
+ # @!attribute [rw] model_type
36
+ # @return [::String]
37
+ # Model to be trained. Supported values are:
38
+ #
39
+ # * **search-tuning**: Fine tuning the search system based on data provided.
40
+ # @!attribute [rw] error_config
41
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::ImportErrorConfig]
42
+ # The desired location of errors incurred during the data ingestion and
43
+ # training.
44
+ class TrainCustomModelRequest
45
+ include ::Google::Protobuf::MessageExts
46
+ extend ::Google::Protobuf::MessageExts::ClassMethods
47
+
48
+ # Cloud Storage training data input.
49
+ # @!attribute [rw] corpus_data_path
50
+ # @return [::String]
51
+ # The Cloud Storage corpus data which could be associated in train data.
52
+ # The data path format is `gs://<bucket_to_data>/<jsonl_file_name>`.
53
+ # A newline delimited jsonl/ndjson file.
54
+ #
55
+ # For search-tuning model, each line should have the _id, title
56
+ # and text. Example:
57
+ # `{"_id": "doc1", title: "relevant doc", "text": "relevant text"}`
58
+ # @!attribute [rw] query_data_path
59
+ # @return [::String]
60
+ # The gcs query data which could be associated in train data.
61
+ # The data path format is `gs://<bucket_to_data>/<jsonl_file_name>`.
62
+ # A newline delimited jsonl/ndjson file.
63
+ #
64
+ # For search-tuning model, each line should have the _id
65
+ # and text. Example: \\{"_id": "query1", "text": "example query"}
66
+ # @!attribute [rw] train_data_path
67
+ # @return [::String]
68
+ # Cloud Storage training data path whose format should be
69
+ # `gs://<bucket_to_data>/<tsv_file_name>`. The file should be in tsv
70
+ # format. Each line should have the doc_id and query_id and score (number).
71
+ #
72
+ # For search-tuning model, it should have the query-id corpus-id
73
+ # score as tsv file header. The score should be a number in `[0, inf+)`.
74
+ # The larger the number is, the more relevant the pair is. Example:
75
+ #
76
+ # * `query-id\tcorpus-id\tscore`
77
+ # * `query1\tdoc1\t1`
78
+ # @!attribute [rw] test_data_path
79
+ # @return [::String]
80
+ # Cloud Storage test data. Same format as train_data_path. If not provided,
81
+ # a random 80/20 train/test split will be performed on train_data_path.
82
+ class GcsTrainingInput
83
+ include ::Google::Protobuf::MessageExts
84
+ extend ::Google::Protobuf::MessageExts::ClassMethods
85
+ end
86
+ end
87
+
88
+ # Response of the
89
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TrainCustomModelRequest TrainCustomModelRequest}.
90
+ # This message is returned by the google.longrunning.Operations.response field.
91
+ # @!attribute [rw] error_samples
92
+ # @return [::Array<::Google::Rpc::Status>]
93
+ # A sample of errors encountered while processing the data.
94
+ # @!attribute [rw] error_config
95
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::ImportErrorConfig]
96
+ # Echoes the destination for the complete errors in the request if set.
97
+ # @!attribute [rw] model_status
98
+ # @return [::String]
99
+ # The trained model status. Possible values are:
100
+ #
101
+ # * **bad-data**: The training data quality is bad.
102
+ # * **no-improvement**: Tuning didn't improve performance. Won't deploy.
103
+ # * **in-progress**: Model training job creation is in progress.
104
+ # * **training**: Model is actively training.
105
+ # * **evaluating**: The model is evaluating trained metrics.
106
+ # * **indexing**: The model trained metrics are indexing.
107
+ # * **ready**: The model is ready for serving.
108
+ # @!attribute [rw] metrics
109
+ # @return [::Google::Protobuf::Map{::String => ::Float}]
110
+ # The metrics of the trained model.
111
+ class TrainCustomModelResponse
112
+ include ::Google::Protobuf::MessageExts
113
+ extend ::Google::Protobuf::MessageExts::ClassMethods
114
+
115
+ # @!attribute [rw] key
116
+ # @return [::String]
117
+ # @!attribute [rw] value
118
+ # @return [::Float]
119
+ class MetricsEntry
120
+ include ::Google::Protobuf::MessageExts
121
+ extend ::Google::Protobuf::MessageExts::ClassMethods
122
+ end
123
+ end
124
+
125
+ # Metadata related to the progress of the TrainCustomModel operation. This is
126
+ # returned by the google.longrunning.Operation.metadata field.
127
+ # @!attribute [rw] create_time
128
+ # @return [::Google::Protobuf::Timestamp]
129
+ # Operation create time.
130
+ # @!attribute [rw] update_time
131
+ # @return [::Google::Protobuf::Timestamp]
132
+ # Operation last update time. If the operation is done, this is also the
133
+ # finish time.
134
+ class TrainCustomModelMetadata
135
+ include ::Google::Protobuf::MessageExts
136
+ extend ::Google::Protobuf::MessageExts::ClassMethods
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
@@ -34,7 +34,7 @@ module Google
34
34
  # @!attribute [rw] name
35
35
  # @return [::String]
36
36
  # Immutable. Fully qualified name
37
- # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
37
+ # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}`
38
38
  # @!attribute [rw] display_name
39
39
  # @return [::String]
40
40
  # Required. The human readable serving config display name. Used in Discovery
@@ -87,8 +87,9 @@ module Google
87
87
  # The ranking expression controls the customized ranking on retrieval
88
88
  # documents. To leverage this, document embedding is required. The ranking
89
89
  # expression setting in ServingConfig applies to all search requests served
90
- # by the serving config. However, if [SearchRequest.ranking_expression][] is
91
- # specified, it overrides the ServingConfig ranking expression.
90
+ # by the serving config. However, if
91
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#ranking_expression SearchRequest.ranking_expression}
92
+ # is specified, it overrides the ServingConfig ranking expression.
92
93
  #
93
94
  # The ranking expression is a single function or multiple functions that are
94
95
  # joined by "+".
@@ -43,7 +43,7 @@ module Google
43
43
  # @!attribute [rw] name
44
44
  # @return [::String]
45
45
  # Required. The resource name of the ServingConfig to get. Format:
46
- # `projects/{project_number}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config_id}`
46
+ # `projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config_id}`
47
47
  class GetServingConfigRequest
48
48
  include ::Google::Protobuf::MessageExts
49
49
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -52,8 +52,8 @@ module Google
52
52
  # Request for ListServingConfigs method.
53
53
  # @!attribute [rw] parent
54
54
  # @return [::String]
55
- # Required. The dataStore resource name. Format:
56
- # `projects/{project_number}/locations/{location}/collections/{collection}/dataStores/{data_store}`
55
+ # Required. Full resource name of the parent resource. Format:
56
+ # `projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine}`
57
57
  # @!attribute [rw] page_size
58
58
  # @return [::Integer]
59
59
  # Optional. Maximum number of results to return. If unspecified, defaults
@@ -0,0 +1,85 @@
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
+ # External session proto definition.
25
+ # @!attribute [rw] name
26
+ # @return [::String]
27
+ # Immutable. Fully qualified name
28
+ # `project/*/locations/global/collections/{collection}/engines/{engine}/sessions/*`
29
+ # @!attribute [rw] state
30
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::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::V1beta::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::V1beta::Query]
52
+ # The user query.
53
+ # @!attribute [rw] answer
54
+ # @return [::String]
55
+ # The resource name of the answer to the user query.
56
+ class Turn
57
+ include ::Google::Protobuf::MessageExts
58
+ extend ::Google::Protobuf::MessageExts::ClassMethods
59
+ end
60
+
61
+ # Enumeration of the state of the session.
62
+ module State
63
+ # State is unspecified.
64
+ STATE_UNSPECIFIED = 0
65
+
66
+ # The session is currently open.
67
+ IN_PROGRESS = 1
68
+ end
69
+ end
70
+
71
+ # Defines a user inputed query.
72
+ # @!attribute [rw] text
73
+ # @return [::String]
74
+ # Plain text.
75
+ # @!attribute [rw] query_id
76
+ # @return [::String]
77
+ # Unique Id for the query.
78
+ class Query
79
+ include ::Google::Protobuf::MessageExts
80
+ extend ::Google::Protobuf::MessageExts::ClassMethods
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end