google-cloud-discovery_engine-v1beta 0.12.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +219 -0
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +205 -0
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +14 -0
  5. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +136 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +19 -1
  7. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +19 -1
  8. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +10 -1
  9. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +10 -1
  10. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +14 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +3 -1
  12. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +3 -1
  13. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +14 -0
  14. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +14 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/client.rb +824 -0
  16. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/credentials.rb +47 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/operations.rb +809 -0
  18. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/paths.rb +318 -0
  19. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/client.rb +770 -0
  20. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/operations.rb +1106 -0
  21. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/service_stub.rb +306 -0
  22. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest.rb +54 -0
  23. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service.rb +57 -0
  24. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/operations.rb +14 -0
  25. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +3 -0
  26. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/client.rb +1035 -0
  27. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/credentials.rb +47 -0
  28. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/operations.rb +809 -0
  29. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/paths.rb +73 -0
  30. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/client.rb +967 -0
  31. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/operations.rb +1106 -0
  32. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/service_stub.rb +426 -0
  33. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest.rb +54 -0
  34. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service.rb +57 -0
  35. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/client.rb +911 -0
  36. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/credentials.rb +47 -0
  37. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/paths.rb +69 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/client.rb +850 -0
  39. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/service_stub.rb +366 -0
  40. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest.rb +53 -0
  41. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service.rb +56 -0
  42. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +14 -0
  43. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +60 -5
  44. data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +68 -0
  45. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +60 -5
  46. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +14 -0
  47. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +14 -0
  48. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +139 -0
  49. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +132 -0
  50. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +14 -0
  51. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +75 -0
  52. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  53. data/lib/google/cloud/discovery_engine/v1beta.rb +3 -0
  54. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +1 -1
  55. data/lib/google/cloud/discoveryengine/v1beta/chunk_pb.rb +50 -0
  56. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +1 -1
  57. data/lib/google/cloud/discoveryengine/v1beta/completion_pb.rb +2 -1
  58. data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +1 -1
  59. data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +8 -0
  60. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +1 -1
  61. data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +1 -1
  62. data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +2 -1
  63. data/lib/google/cloud/discoveryengine/v1beta/data_store_service_pb.rb +1 -1
  64. data/lib/google/cloud/discoveryengine/v1beta/document_processing_config_pb.rb +4 -1
  65. data/lib/google/cloud/discoveryengine/v1beta/evaluation_pb.rb +56 -0
  66. data/lib/google/cloud/discoveryengine/v1beta/evaluation_service_pb.rb +59 -0
  67. data/lib/google/cloud/discoveryengine/v1beta/evaluation_service_services_pb.rb +57 -0
  68. data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +12 -1
  69. data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +7 -1
  70. data/lib/google/cloud/discoveryengine/v1beta/sample_query_pb.rb +49 -0
  71. data/lib/google/cloud/discoveryengine/v1beta/sample_query_service_pb.rb +59 -0
  72. data/lib/google/cloud/discoveryengine/v1beta/sample_query_service_services_pb.rb +63 -0
  73. data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_pb.rb +47 -0
  74. data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_service_pb.rb +57 -0
  75. data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_service_services_pb.rb +59 -0
  76. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +20 -1
  77. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +2 -1
  78. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +5 -0
  79. data/proto_docs/google/api/client.rb +14 -10
  80. data/proto_docs/google/api/resource.rb +7 -2
  81. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +14 -0
  82. data/proto_docs/google/cloud/discoveryengine/v1beta/chunk.rb +119 -0
  83. data/proto_docs/google/cloud/discoveryengine/v1beta/completion.rb +31 -0
  84. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +38 -2
  85. data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +16 -0
  86. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +25 -0
  87. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store_service.rb +10 -0
  88. data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +1 -1
  89. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +43 -2
  90. data/proto_docs/google/cloud/discoveryengine/v1beta/evaluation.rb +223 -0
  91. data/proto_docs/google/cloud/discoveryengine/v1beta/evaluation_service.rb +194 -0
  92. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +199 -0
  93. data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +119 -0
  94. data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query.rb +82 -0
  95. data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_service.rb +179 -0
  96. data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_set.rb +57 -0
  97. data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_set_service.rb +186 -0
  98. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +401 -8
  99. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +11 -5
  100. metadata +44 -2
@@ -130,6 +130,19 @@ module Google
130
130
  # Highly recommended for analytics.
131
131
  # {::Google::Cloud::DiscoveryEngine::V1beta::UserInfo#user_agent UserInfo.user_agent}
132
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.
140
+ # @!attribute [rw] region_code
141
+ # @return [::String]
142
+ # The Unicode country/region code (CLDR) of a location, such as "US" and
143
+ # "419". For more information, see [Standard
144
+ # fields](https://cloud.google.com/apis/design/standard_fields). If set,
145
+ # then results will be boosted based on the region_code provided.
133
146
  # @!attribute [rw] facet_specs
134
147
  # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec>]
135
148
  # Facet specifications for faceted search. If empty, no facets are returned.
@@ -203,20 +216,26 @@ module Google
203
216
  # documents. This overrides
204
217
  # {::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig#ranking_expression ServingConfig.ranking_expression}.
205
218
  # The ranking expression is a single function or multiple functions that are
206
- # joint by "+".
219
+ # joined by "+".
220
+ #
207
221
  # * ranking_expression = function, { " + ", function };
222
+ #
208
223
  # Supported functions:
224
+ #
209
225
  # * double * relevance_score
210
226
  # * double * dotProduct(embedding_field_path)
227
+ #
211
228
  # Function variables:
212
- # `relevance_score`: pre-defined keywords, used for measure relevance
229
+ #
230
+ # * `relevance_score`: pre-defined keywords, used for measure relevance
213
231
  # between query and document.
214
- # `embedding_field_path`: the document embedding field
232
+ # * `embedding_field_path`: the document embedding field
215
233
  # used with query embedding vector.
216
- # `dotProduct`: embedding function between embedding_field_path and query
234
+ # * `dotProduct`: embedding function between embedding_field_path and query
217
235
  # embedding vector.
218
236
  #
219
237
  # Example ranking expression:
238
+ #
220
239
  # If document has an embedding field doc_embedding, the ranking expression
221
240
  # could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
222
241
  # @!attribute [rw] safe_search
@@ -242,6 +261,48 @@ module Google
242
261
  # See [Google Cloud
243
262
  # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
244
263
  # for more details.
264
+ # @!attribute [rw] natural_language_query_understanding_spec
265
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec]
266
+ # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional
267
+ # natural language query understanding will be done.
268
+ # @!attribute [rw] search_as_you_type_spec
269
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec]
270
+ # Search as you type configuration. Only supported for the
271
+ # {::Google::Cloud::DiscoveryEngine::V1beta::IndustryVertical::MEDIA IndustryVertical.MEDIA}
272
+ # vertical.
273
+ # @!attribute [rw] session
274
+ # @return [::String]
275
+ # The session resource name. Optional.
276
+ #
277
+ # Session allows users to do multi-turn /search API calls or coordination
278
+ # between /search API calls and /answer API calls.
279
+ #
280
+ # Example #1 (multi-turn /search API calls):
281
+ # 1. Call /search API with the auto-session mode (see below).
282
+ # 2. Call /search API with the session ID generated in the first call.
283
+ # Here, the previous search query gets considered in query
284
+ # standing. I.e., if the first query is "How did Alphabet do in 2022?"
285
+ # and the current query is "How about 2023?", the current query will
286
+ # be interpreted as "How did Alphabet do in 2023?".
287
+ #
288
+ # Example #2 (coordination between /search API calls and /answer API calls):
289
+ # 1. Call /search API with the auto-session mode (see below).
290
+ # 2. Call /answer API with the session ID generated in the first call.
291
+ # Here, the answer generation happens in the context of the search
292
+ # results from the first search call.
293
+ #
294
+ # Auto-session mode: when `projects/.../sessions/-` is used, a new session
295
+ # gets automatically created. Otherwise, users can use the create-session API
296
+ # to create a session manually.
297
+ #
298
+ # Multi-turn Search feature is currently at private GA stage. Please use
299
+ # v1alpha or v1beta version instead before we launch this feature to public
300
+ # GA. Or ask for allowlisting through Google Support team.
301
+ # @!attribute [rw] session_spec
302
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SessionSpec]
303
+ # Session specification.
304
+ #
305
+ # Can be used only when `session` is set.
245
306
  class SearchRequest
246
307
  include ::Google::Protobuf::MessageExts
247
308
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -257,8 +318,8 @@ module Google
257
318
  end
258
319
 
259
320
  # A struct to define data stores to filter on in a search call and
260
- # configurations for those data stores. A maximum of 1 DataStoreSpec per
261
- # data_store is allowed. Otherwise, an `INVALID_ARGUMENT` error is returned.
321
+ # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
322
+ # error is returned.
262
323
  # @!attribute [rw] data_store
263
324
  # @return [::String]
264
325
  # Required. Full resource name of
@@ -278,6 +339,9 @@ module Google
278
339
  # Maximum facet values that are returned for this facet. If
279
340
  # unspecified, defaults to 20. The maximum allowed value is 300. Values
280
341
  # above 300 are coerced to 300.
342
+ # For aggregation in healthcare search, when the [FacetKey.key] is
343
+ # "healthcare_aggregation_key", the limit will be overridden to
344
+ # 10,000 internally, regardless of the value set here.
281
345
  #
282
346
  # If this field is negative, an `INVALID_ARGUMENT` is returned.
283
347
  # @!attribute [rw] excluded_filter_keys
@@ -615,6 +679,17 @@ module Google
615
679
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
616
680
  # If there is no extractive_content_spec provided, there will be no
617
681
  # extractive answer in the search response.
682
+ # @!attribute [rw] search_result_mode
683
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
684
+ # Specifies the search result mode. If unspecified, the
685
+ # search result mode defaults to `DOCUMENTS`.
686
+ # @!attribute [rw] chunk_spec
687
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
688
+ # Specifies the chunk spec to be returned from the search response.
689
+ # Only available if the
690
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
691
+ # is set to
692
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
618
693
  class ContentSearchSpec
619
694
  include ::Google::Protobuf::MessageExts
620
695
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -651,8 +726,9 @@ module Google
651
726
  #
652
727
  # At most 10 results for documents mode, or 50 for chunks mode, can be
653
728
  # used to generate a summary. The chunks mode is used when
654
- # [SearchRequest.ContentSearchSpec.search_result_mode][] is set to
655
- # [CHUNKS][SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS].
729
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
730
+ # is set to
731
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
656
732
  # @!attribute [rw] include_citations
657
733
  # @return [::Boolean]
658
734
  # Specifies whether to include citations in the summary. The default
@@ -809,6 +885,40 @@ module Google
809
885
  include ::Google::Protobuf::MessageExts
810
886
  extend ::Google::Protobuf::MessageExts::ClassMethods
811
887
  end
888
+
889
+ # Specifies the chunk spec to be returned from the search response.
890
+ # Only available if the
891
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
892
+ # is set to
893
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
894
+ # @!attribute [rw] num_previous_chunks
895
+ # @return [::Integer]
896
+ # The number of previous chunks to be returned of the current chunk. The
897
+ # maximum allowed value is 3.
898
+ # If not specified, no previous chunks will be returned.
899
+ # @!attribute [rw] num_next_chunks
900
+ # @return [::Integer]
901
+ # The number of next chunks to be returned of the current chunk. The
902
+ # maximum allowed value is 3.
903
+ # If not specified, no next chunks will be returned.
904
+ class ChunkSpec
905
+ include ::Google::Protobuf::MessageExts
906
+ extend ::Google::Protobuf::MessageExts::ClassMethods
907
+ end
908
+
909
+ # Specifies the search result mode. If unspecified, the
910
+ # search result mode defaults to `DOCUMENTS`.
911
+ module SearchResultMode
912
+ # Default value.
913
+ SEARCH_RESULT_MODE_UNSPECIFIED = 0
914
+
915
+ # Returns documents in the search result.
916
+ DOCUMENTS = 1
917
+
918
+ # Returns chunks in the search result. Only available if the
919
+ # [DataStore.DocumentProcessingConfig.chunking_config][] is specified.
920
+ CHUNKS = 2
921
+ end
812
922
  end
813
923
 
814
924
  # The specification that uses customized query embedding vector to do
@@ -833,6 +943,107 @@ module Google
833
943
  end
834
944
  end
835
945
 
946
+ # Specification to enable natural language understanding capabilities for
947
+ # search requests.
948
+ # @!attribute [rw] filter_extraction_condition
949
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
950
+ # The condition under which filter extraction should occur.
951
+ # Default to [Condition.DISABLED][].
952
+ # @!attribute [rw] geo_search_query_detection_field_names
953
+ # @return [::Array<::String>]
954
+ # Field names used for location-based filtering, where geolocation filters
955
+ # are detected in natural language search queries.
956
+ # Only valid when the FilterExtractionCondition is set to `ENABLED`.
957
+ #
958
+ # If this field is set, it overrides the field names set in
959
+ # [ServingConfig.geo_search_query_detection_field_names][google.cloud.discoveryengine.v1beta.ServingConfig.geo_search_query_detection_field_names].
960
+ class NaturalLanguageQueryUnderstandingSpec
961
+ include ::Google::Protobuf::MessageExts
962
+ extend ::Google::Protobuf::MessageExts::ClassMethods
963
+
964
+ # Enum describing under which condition filter extraction should occur.
965
+ module FilterExtractionCondition
966
+ # Server behavior defaults to [Condition.DISABLED][].
967
+ CONDITION_UNSPECIFIED = 0
968
+
969
+ # Disables NL filter extraction.
970
+ DISABLED = 1
971
+
972
+ # Enables NL filter extraction.
973
+ ENABLED = 2
974
+ end
975
+ end
976
+
977
+ # Specification for search as you type in search requests.
978
+ # @!attribute [rw] condition
979
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
980
+ # The condition under which search as you type should occur.
981
+ # Default to
982
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
983
+ class SearchAsYouTypeSpec
984
+ include ::Google::Protobuf::MessageExts
985
+ extend ::Google::Protobuf::MessageExts::ClassMethods
986
+
987
+ # Enum describing under which condition search as you type should occur.
988
+ module Condition
989
+ # Server behavior defaults to
990
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
991
+ CONDITION_UNSPECIFIED = 0
992
+
993
+ # Disables Search As You Type.
994
+ DISABLED = 1
995
+
996
+ # Enables Search As You Type.
997
+ ENABLED = 2
998
+ end
999
+ end
1000
+
1001
+ # Session specification.
1002
+ #
1003
+ # Multi-turn Search feature is currently at private GA stage. Please use
1004
+ # v1alpha or v1beta version instead before we launch this feature to public
1005
+ # GA. Or ask for allowlisting through Google Support team.
1006
+ # @!attribute [rw] query_id
1007
+ # @return [::String]
1008
+ # If set, the search result gets stored to the "turn" specified by this
1009
+ # query ID.
1010
+ #
1011
+ # Example: Let's say the session looks like this:
1012
+ # session {
1013
+ # name: ".../sessions/xxx"
1014
+ # turns {
1015
+ # query { text: "What is foo?" query_id: ".../questions/yyy" }
1016
+ # answer: "Foo is ..."
1017
+ # }
1018
+ # turns {
1019
+ # query { text: "How about bar then?" query_id: ".../questions/zzz" }
1020
+ # }
1021
+ # }
1022
+ #
1023
+ # The user can call /search API with a request like this:
1024
+ #
1025
+ # session: ".../sessions/xxx"
1026
+ # session_spec { query_id: ".../questions/zzz" }
1027
+ #
1028
+ # Then, the API stores the search result, associated with the last turn.
1029
+ # The stored search result can be used by a subsequent /answer API call
1030
+ # (with the session ID and the query ID specified). Also, it is possible
1031
+ # to call /search and /answer in parallel with the same session ID & query
1032
+ # ID.
1033
+ # @!attribute [rw] search_result_persistence_count
1034
+ # @return [::Integer]
1035
+ # The number of top search results to persist. The persisted search results
1036
+ # can be used for the subsequent /answer api call.
1037
+ #
1038
+ # This field is simliar to the `summary_result_count` field in
1039
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
1040
+ #
1041
+ # At most 10 results for documents mode, or 50 for chunks mode.
1042
+ class SessionSpec
1043
+ include ::Google::Protobuf::MessageExts
1044
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1045
+ end
1046
+
836
1047
  # @!attribute [rw] key
837
1048
  # @return [::String]
838
1049
  # @!attribute [rw] value
@@ -911,6 +1122,16 @@ module Google
911
1122
  # @!attribute [rw] query_expansion_info
912
1123
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::QueryExpansionInfo]
913
1124
  # Query expansion information for the returned results.
1125
+ # @!attribute [rw] natural_language_query_understanding_info
1126
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::NaturalLanguageQueryUnderstandingInfo]
1127
+ # Natural language query understanding information for the returned results.
1128
+ # @!attribute [rw] session_info
1129
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SessionInfo]
1130
+ # Session information.
1131
+ #
1132
+ # Only set if
1133
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#session SearchRequest.session}
1134
+ # is provided. See its description for more details.
914
1135
  class SearchResponse
915
1136
  include ::Google::Protobuf::MessageExts
916
1137
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -924,6 +1145,12 @@ module Google
924
1145
  # @return [::Google::Cloud::DiscoveryEngine::V1beta::Document]
925
1146
  # The document data snippet in the search response. Only fields that are
926
1147
  # marked as `retrievable` are populated.
1148
+ # @!attribute [rw] chunk
1149
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Chunk]
1150
+ # The chunk data in the search response if the
1151
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
1152
+ # is set to
1153
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
927
1154
  # @!attribute [rw] model_scores
928
1155
  # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1beta::DoubleList}]
929
1156
  # Google provided available scores.
@@ -1152,6 +1379,12 @@ module Google
1152
1379
  #
1153
1380
  # Google skips the summary if the LLM addon is not enabled.
1154
1381
  LLM_ADDON_NOT_ENABLED = 5
1382
+
1383
+ # The no relevant content case.
1384
+ #
1385
+ # Google skips the summary if there is no relevant content in the
1386
+ # retrieved search results.
1387
+ NO_RELEVANT_CONTENT = 6
1155
1388
  end
1156
1389
  end
1157
1390
 
@@ -1183,6 +1416,166 @@ module Google
1183
1416
  include ::Google::Protobuf::MessageExts
1184
1417
  extend ::Google::Protobuf::MessageExts::ClassMethods
1185
1418
  end
1419
+
1420
+ # Information describing what natural language understanding was
1421
+ # done on the input query.
1422
+ # @!attribute [rw] extracted_filters
1423
+ # @return [::String]
1424
+ # The filters that were extracted from the input query.
1425
+ # @!attribute [rw] rewritten_query
1426
+ # @return [::String]
1427
+ # Rewritten input query minus the extracted filters.
1428
+ # @!attribute [rw] structured_extracted_filter
1429
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter]
1430
+ # The filters that were extracted from the input query represented in a
1431
+ # structured form.
1432
+ class NaturalLanguageQueryUnderstandingInfo
1433
+ include ::Google::Protobuf::MessageExts
1434
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1435
+
1436
+ # The filters that were extracted from the input query represented in a
1437
+ # structured form.
1438
+ # @!attribute [rw] expression
1439
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression]
1440
+ # The expression denoting the filter that was extracted from the input
1441
+ # query in a structured form. It can be a simple expression denoting a
1442
+ # single string, numerical or geolocation constraint or a compound
1443
+ # expression which is a combination of multiple expressions connected
1444
+ # using logical (OR and AND) operators.
1445
+ class StructuredExtractedFilter
1446
+ include ::Google::Protobuf::MessageExts
1447
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1448
+
1449
+ # Constraint expression of a string field.
1450
+ # @!attribute [rw] field_name
1451
+ # @return [::String]
1452
+ # Name of the string field as defined in the schema.
1453
+ # @!attribute [rw] values
1454
+ # @return [::Array<::String>]
1455
+ # Values of the string field. The record will only be returned if the
1456
+ # field value matches one of the values specified here.
1457
+ class StringConstraint
1458
+ include ::Google::Protobuf::MessageExts
1459
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1460
+ end
1461
+
1462
+ # Constraint expression of a number field. Example: price < 100.
1463
+ # @!attribute [rw] field_name
1464
+ # @return [::String]
1465
+ # Name of the numerical field as defined in the schema.
1466
+ # @!attribute [rw] comparison
1467
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint::Comparison]
1468
+ # The comparison operation performed between the field value and the
1469
+ # value specified in the constraint.
1470
+ # @!attribute [rw] value
1471
+ # @return [::Float]
1472
+ # The value specified in the numerical constraint.
1473
+ class NumberConstraint
1474
+ include ::Google::Protobuf::MessageExts
1475
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1476
+
1477
+ # The comparison operation that was performed.
1478
+ module Comparison
1479
+ # Undefined comparison operator.
1480
+ COMPARISON_UNSPECIFIED = 0
1481
+
1482
+ # Denotes equality `=` operator.
1483
+ EQUALS = 1
1484
+
1485
+ # Denotes less than or equal to `<=` operator.
1486
+ LESS_THAN_EQUALS = 2
1487
+
1488
+ # Denotes less than `<` operator.
1489
+ LESS_THAN = 3
1490
+
1491
+ # Denotes greater than or equal to `>=` operator.
1492
+ GREATER_THAN_EQUALS = 4
1493
+
1494
+ # Denotes greater than `>` operator.
1495
+ GREATER_THAN = 5
1496
+ end
1497
+ end
1498
+
1499
+ # Constraint of a geolocation field.
1500
+ # Name of the geolocation field as defined in the schema.
1501
+ # @!attribute [rw] field_name
1502
+ # @return [::String]
1503
+ # The name of the geolocation field as defined in the schema.
1504
+ # @!attribute [rw] address
1505
+ # @return [::String]
1506
+ # The reference address that was inferred from the input query. The
1507
+ # proximity of the reference address to the geolocation field will be
1508
+ # used to filter the results.
1509
+ # @!attribute [rw] radius_in_meters
1510
+ # @return [::Float]
1511
+ # The radius in meters around the address. The record is returned if
1512
+ # the location of the geolocation field is within the radius.
1513
+ class GeolocationConstraint
1514
+ include ::Google::Protobuf::MessageExts
1515
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1516
+ end
1517
+
1518
+ # Logical `And` operator.
1519
+ # @!attribute [rw] expressions
1520
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression>]
1521
+ # The expressions that were ANDed together.
1522
+ class AndExpression
1523
+ include ::Google::Protobuf::MessageExts
1524
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1525
+ end
1526
+
1527
+ # Logical `Or` operator.
1528
+ # @!attribute [rw] expressions
1529
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression>]
1530
+ # The expressions that were ORed together.
1531
+ class OrExpression
1532
+ include ::Google::Protobuf::MessageExts
1533
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1534
+ end
1535
+
1536
+ # The expression denoting the filter that was extracted from the input
1537
+ # query.
1538
+ # @!attribute [rw] string_constraint
1539
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::StringConstraint]
1540
+ # String constraint expression.
1541
+ # @!attribute [rw] number_constraint
1542
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint]
1543
+ # Numerical constraint expression.
1544
+ # @!attribute [rw] geolocation_constraint
1545
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::GeolocationConstraint]
1546
+ # Geolocation constraint expression.
1547
+ # @!attribute [rw] and_expr
1548
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::AndExpression]
1549
+ # Logical "And" compound operator connecting multiple expressions.
1550
+ # @!attribute [rw] or_expr
1551
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::OrExpression]
1552
+ # Logical "Or" compound operator connecting multiple expressions.
1553
+ class Expression
1554
+ include ::Google::Protobuf::MessageExts
1555
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1556
+ end
1557
+ end
1558
+ end
1559
+
1560
+ # Information about the session.
1561
+ # @!attribute [rw] name
1562
+ # @return [::String]
1563
+ # Name of the session.
1564
+ # If the auto-session mode is used (when
1565
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#session SearchRequest.session}
1566
+ # ends with "-"), this field holds the newly generated session name.
1567
+ # @!attribute [rw] query_id
1568
+ # @return [::String]
1569
+ # Query ID that corresponds to this search API call.
1570
+ # One session can have multiple turns, each with a unique query ID.
1571
+ #
1572
+ # By specifying the session name and this query ID in the Answer API call,
1573
+ # the answer generation happens in the context of the search results from
1574
+ # this search call.
1575
+ class SessionInfo
1576
+ include ::Google::Protobuf::MessageExts
1577
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1578
+ end
1186
1579
  end
1187
1580
  end
1188
1581
  end
@@ -93,21 +93,27 @@ module Google
93
93
  #
94
94
  # The ranking expression is a single function or multiple functions that are
95
95
  # joined by "+".
96
+ #
96
97
  # * ranking_expression = function, { " + ", function };
98
+ #
97
99
  # Supported functions:
100
+ #
98
101
  # * double * relevance_score
99
102
  # * double * dotProduct(embedding_field_path)
103
+ #
100
104
  # Function variables:
101
- # relevance_score: pre-defined keywords, used for measure relevance between
102
- # query and document.
103
- # embedding_field_path: the document embedding field
105
+ #
106
+ # * `relevance_score`: pre-defined keywords, used for measure relevance
107
+ # between query and document.
108
+ # * `embedding_field_path`: the document embedding field
104
109
  # used with query embedding vector.
105
- # dotProduct: embedding function between embedding_field_path and query
110
+ # * `dotProduct`: embedding function between embedding_field_path and query
106
111
  # embedding vector.
107
112
  #
108
113
  # Example ranking expression:
114
+ #
109
115
  # If document has an embedding field doc_embedding, the ranking expression
110
- # could be 0.5 * relevance_score + 0.3 * dotProduct(doc_embedding).
116
+ # could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
111
117
  # @!attribute [r] create_time
112
118
  # @return [::Google::Protobuf::Timestamp]
113
119
  # Output only. ServingConfig created timestamp.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-discovery_engine-v1beta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-29 00:00:00.000000000 Z
11
+ date: 2024-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -129,6 +129,15 @@ files:
129
129
  - lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb
130
130
  - lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb
131
131
  - lib/google/cloud/discovery_engine/v1beta/engine_service/rest/service_stub.rb
132
+ - lib/google/cloud/discovery_engine/v1beta/evaluation_service.rb
133
+ - lib/google/cloud/discovery_engine/v1beta/evaluation_service/client.rb
134
+ - lib/google/cloud/discovery_engine/v1beta/evaluation_service/credentials.rb
135
+ - lib/google/cloud/discovery_engine/v1beta/evaluation_service/operations.rb
136
+ - lib/google/cloud/discovery_engine/v1beta/evaluation_service/paths.rb
137
+ - lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest.rb
138
+ - lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/client.rb
139
+ - lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/operations.rb
140
+ - lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/service_stub.rb
132
141
  - lib/google/cloud/discovery_engine/v1beta/grounded_generation_service.rb
133
142
  - lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb
134
143
  - lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/credentials.rb
@@ -160,6 +169,22 @@ files:
160
169
  - lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb
161
170
  - lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb
162
171
  - lib/google/cloud/discovery_engine/v1beta/rest.rb
172
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_service.rb
173
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_service/client.rb
174
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_service/credentials.rb
175
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_service/operations.rb
176
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_service/paths.rb
177
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest.rb
178
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/client.rb
179
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/operations.rb
180
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/service_stub.rb
181
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_set_service.rb
182
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/client.rb
183
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/credentials.rb
184
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/paths.rb
185
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest.rb
186
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/client.rb
187
+ - lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/service_stub.rb
163
188
  - lib/google/cloud/discovery_engine/v1beta/schema_service.rb
164
189
  - lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb
165
190
  - lib/google/cloud/discovery_engine/v1beta/schema_service/credentials.rb
@@ -212,6 +237,7 @@ files:
212
237
  - lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb
213
238
  - lib/google/cloud/discovery_engine/v1beta/version.rb
214
239
  - lib/google/cloud/discoveryengine/v1beta/answer_pb.rb
240
+ - lib/google/cloud/discoveryengine/v1beta/chunk_pb.rb
215
241
  - lib/google/cloud/discoveryengine/v1beta/common_pb.rb
216
242
  - lib/google/cloud/discoveryengine/v1beta/completion_pb.rb
217
243
  - lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb
@@ -233,6 +259,9 @@ files:
233
259
  - lib/google/cloud/discoveryengine/v1beta/engine_pb.rb
234
260
  - lib/google/cloud/discoveryengine/v1beta/engine_service_pb.rb
235
261
  - lib/google/cloud/discoveryengine/v1beta/engine_service_services_pb.rb
262
+ - lib/google/cloud/discoveryengine/v1beta/evaluation_pb.rb
263
+ - lib/google/cloud/discoveryengine/v1beta/evaluation_service_pb.rb
264
+ - lib/google/cloud/discoveryengine/v1beta/evaluation_service_services_pb.rb
236
265
  - lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_pb.rb
237
266
  - lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_services_pb.rb
238
267
  - lib/google/cloud/discoveryengine/v1beta/grounding_pb.rb
@@ -245,6 +274,12 @@ files:
245
274
  - lib/google/cloud/discoveryengine/v1beta/rank_service_services_pb.rb
246
275
  - lib/google/cloud/discoveryengine/v1beta/recommendation_service_pb.rb
247
276
  - lib/google/cloud/discoveryengine/v1beta/recommendation_service_services_pb.rb
277
+ - lib/google/cloud/discoveryengine/v1beta/sample_query_pb.rb
278
+ - lib/google/cloud/discoveryengine/v1beta/sample_query_service_pb.rb
279
+ - lib/google/cloud/discoveryengine/v1beta/sample_query_service_services_pb.rb
280
+ - lib/google/cloud/discoveryengine/v1beta/sample_query_set_pb.rb
281
+ - lib/google/cloud/discoveryengine/v1beta/sample_query_set_service_pb.rb
282
+ - lib/google/cloud/discoveryengine/v1beta/sample_query_set_service_services_pb.rb
248
283
  - lib/google/cloud/discoveryengine/v1beta/schema_pb.rb
249
284
  - lib/google/cloud/discoveryengine/v1beta/schema_service_pb.rb
250
285
  - lib/google/cloud/discoveryengine/v1beta/schema_service_services_pb.rb
@@ -269,6 +304,7 @@ files:
269
304
  - proto_docs/google/api/launch_stage.rb
270
305
  - proto_docs/google/api/resource.rb
271
306
  - proto_docs/google/cloud/discoveryengine/v1beta/answer.rb
307
+ - proto_docs/google/cloud/discoveryengine/v1beta/chunk.rb
272
308
  - proto_docs/google/cloud/discoveryengine/v1beta/common.rb
273
309
  - proto_docs/google/cloud/discoveryengine/v1beta/completion.rb
274
310
  - proto_docs/google/cloud/discoveryengine/v1beta/completion_service.rb
@@ -284,6 +320,8 @@ files:
284
320
  - proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb
285
321
  - proto_docs/google/cloud/discoveryengine/v1beta/engine.rb
286
322
  - proto_docs/google/cloud/discoveryengine/v1beta/engine_service.rb
323
+ - proto_docs/google/cloud/discoveryengine/v1beta/evaluation.rb
324
+ - proto_docs/google/cloud/discoveryengine/v1beta/evaluation_service.rb
287
325
  - proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb
288
326
  - proto_docs/google/cloud/discoveryengine/v1beta/grounding.rb
289
327
  - proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb
@@ -292,6 +330,10 @@ files:
292
330
  - proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb
293
331
  - proto_docs/google/cloud/discoveryengine/v1beta/rank_service.rb
294
332
  - proto_docs/google/cloud/discoveryengine/v1beta/recommendation_service.rb
333
+ - proto_docs/google/cloud/discoveryengine/v1beta/sample_query.rb
334
+ - proto_docs/google/cloud/discoveryengine/v1beta/sample_query_service.rb
335
+ - proto_docs/google/cloud/discoveryengine/v1beta/sample_query_set.rb
336
+ - proto_docs/google/cloud/discoveryengine/v1beta/sample_query_set_service.rb
295
337
  - proto_docs/google/cloud/discoveryengine/v1beta/schema.rb
296
338
  - proto_docs/google/cloud/discoveryengine/v1beta/schema_service.rb
297
339
  - proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb