google-cloud-discovery_engine-v1beta 0.3.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +21 -3
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +21 -3
  5. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +959 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/credentials.rb +47 -0
  7. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/paths.rb +176 -0
  8. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +797 -0
  9. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +450 -0
  10. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest.rb +52 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service.rb +55 -0
  12. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +19 -4
  13. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +19 -4
  14. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +42 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +14 -0
  16. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +14 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +2 -1
  18. data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +14 -0
  19. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +14 -0
  20. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +42 -0
  21. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +57 -12
  22. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +57 -12
  23. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +16 -2
  24. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +16 -2
  25. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +42 -0
  26. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  27. data/lib/google/cloud/discovery_engine/v1beta.rb +2 -1
  28. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +2 -1
  29. data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +1 -1
  30. data/lib/google/cloud/discoveryengine/v1beta/conversation_pb.rb +55 -0
  31. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +61 -0
  32. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_services_pb.rb +67 -0
  33. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +7 -1
  34. data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +1 -1
  35. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +1 -1
  36. data/proto_docs/google/api/field_behavior.rb +14 -0
  37. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +10 -2
  38. data/proto_docs/google/cloud/discoveryengine/v1beta/completion_service.rb +13 -2
  39. data/proto_docs/google/cloud/discoveryengine/v1beta/conversation.rb +138 -0
  40. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +209 -0
  41. data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +2 -4
  42. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +2 -1
  43. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +17 -17
  44. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +295 -61
  45. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +41 -29
  46. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event_service.rb +1 -1
  47. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  48. metadata +36 -3
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/discoveryengine/v1beta/document_service_pb"
21
21
  require "google/cloud/discovery_engine/v1beta/document_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -148,6 +149,12 @@ module Google
148
149
  config.endpoint = @config.endpoint
149
150
  end
150
151
 
152
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
153
+ config.credentials = credentials
154
+ config.quota_project = @quota_project_id
155
+ config.endpoint = @config.endpoint
156
+ end
157
+
151
158
  @document_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
152
159
  end
153
160
 
@@ -158,6 +165,13 @@ module Google
158
165
  #
159
166
  attr_reader :operations_client
160
167
 
168
+ ##
169
+ # Get the associated client for mix-in of the Locations.
170
+ #
171
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
172
+ #
173
+ attr_reader :location_client
174
+
161
175
  # Service calls
162
176
 
163
177
  ##
@@ -255,7 +269,8 @@ module Google
255
269
  # Use `default_branch` as the branch ID, to list documents under the default
256
270
  # branch.
257
271
  #
258
- # If the caller does not have permission to list [Documents][]s under this
272
+ # If the caller does not have permission to list
273
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s under this
259
274
  # branch, regardless of whether or not this branch exists, a
260
275
  # `PERMISSION_DENIED` error is returned.
261
276
  # @param page_size [::Integer]
@@ -601,7 +616,7 @@ module Google
601
616
  # `false`, {::Google::Cloud::DiscoveryEngine::V1beta::Document#id Document.id}s
602
617
  # have to be specified using
603
618
  # {::Google::Cloud::DiscoveryEngine::V1beta::ImportDocumentsRequest#id_field id_field},
604
- # otherwises, documents without IDs will fail to be imported.
619
+ # otherwise, documents without IDs fail to be imported.
605
620
  #
606
621
  # Only set this field when using
607
622
  # {::Google::Cloud::DiscoveryEngine::V1beta::GcsSource GcsSource} or
@@ -621,12 +636,12 @@ module Google
621
636
  # {::Google::Cloud::DiscoveryEngine::V1beta::BigQuerySource BigQuerySource} it is
622
637
  # the column name of the BigQuery table where the unique ids are stored.
623
638
  #
624
- # The values of the JSON field or the BigQuery column will be used as the
639
+ # The values of the JSON field or the BigQuery column are used as the
625
640
  # {::Google::Cloud::DiscoveryEngine::V1beta::Document#id Document.id}s. The JSON
626
641
  # field or the BigQuery column must be of string type, and the values must be
627
642
  # set as valid strings conform to
628
643
  # [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.
629
- # Otherwise, documents without valid IDs will fail to be imported.
644
+ # Otherwise, documents without valid IDs fail to be imported.
630
645
  #
631
646
  # Only set this field when using
632
647
  # {::Google::Cloud::DiscoveryEngine::V1beta::GcsSource GcsSource} or
@@ -734,6 +734,20 @@ module Google
734
734
  ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false]
735
735
  ]
736
736
  )
737
+ .with_bindings(
738
+ uri_method: :get,
739
+ uri_template: "/v1beta/{name}/operations",
740
+ matches: [
741
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false]
742
+ ]
743
+ )
744
+ .with_bindings(
745
+ uri_method: :get,
746
+ uri_template: "/v1beta/{name}/operations",
747
+ matches: [
748
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false]
749
+ ]
750
+ )
737
751
  .with_bindings(
738
752
  uri_method: :get,
739
753
  uri_template: "/v1beta/{name}/operations",
@@ -741,6 +755,13 @@ module Google
741
755
  ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false]
742
756
  ]
743
757
  )
758
+ .with_bindings(
759
+ uri_method: :get,
760
+ uri_template: "/v1beta/{name}/operations",
761
+ matches: [
762
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false]
763
+ ]
764
+ )
744
765
  .with_bindings(
745
766
  uri_method: :get,
746
767
  uri_template: "/v1beta/{name}/operations",
@@ -825,6 +846,27 @@ module Google
825
846
  ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false]
826
847
  ]
827
848
  )
849
+ .with_bindings(
850
+ uri_method: :get,
851
+ uri_template: "/v1beta/{name}",
852
+ matches: [
853
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false]
854
+ ]
855
+ )
856
+ .with_bindings(
857
+ uri_method: :get,
858
+ uri_template: "/v1beta/{name}",
859
+ matches: [
860
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false]
861
+ ]
862
+ )
863
+ .with_bindings(
864
+ uri_method: :get,
865
+ uri_template: "/v1beta/{name}",
866
+ matches: [
867
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false]
868
+ ]
869
+ )
828
870
  .with_bindings(
829
871
  uri_method: :get,
830
872
  uri_template: "/v1beta/{name}",
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/discoveryengine/v1beta/recommendation_service_pb"
21
+ require "google/cloud/location"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -138,6 +139,12 @@ module Google
138
139
  @quota_project_id = @config.quota_project
139
140
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
140
141
 
142
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
143
+ config.credentials = credentials
144
+ config.quota_project = @quota_project_id
145
+ config.endpoint = @config.endpoint
146
+ end
147
+
141
148
  @recommendation_service_stub = ::Gapic::ServiceStub.new(
142
149
  ::Google::Cloud::DiscoveryEngine::V1beta::RecommendationService::Stub,
143
150
  credentials: credentials,
@@ -147,6 +154,13 @@ module Google
147
154
  )
148
155
  end
149
156
 
157
+ ##
158
+ # Get the associated client for mix-in of the Locations.
159
+ #
160
+ # @return [Google::Cloud::Location::Locations::Client]
161
+ #
162
+ attr_reader :location_client
163
+
150
164
  # Service calls
151
165
 
152
166
  ##
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/discoveryengine/v1beta/recommendation_service_pb"
21
21
  require "google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -135,9 +136,22 @@ module Google
135
136
  @quota_project_id = @config.quota_project
136
137
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
137
138
 
139
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
140
+ config.credentials = credentials
141
+ config.quota_project = @quota_project_id
142
+ config.endpoint = @config.endpoint
143
+ end
144
+
138
145
  @recommendation_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::RecommendationService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
139
146
  end
140
147
 
148
+ ##
149
+ # Get the associated client for mix-in of the Locations.
150
+ #
151
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
152
+ #
153
+ attr_reader :location_client
154
+
141
155
  # Service calls
142
156
 
143
157
  ##
@@ -17,10 +17,11 @@
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
19
  require "google/cloud/discovery_engine/v1beta/completion_service/rest"
20
+ require "google/cloud/discovery_engine/v1beta/search_service/rest"
21
+ require "google/cloud/discovery_engine/v1beta/conversational_search_service/rest"
20
22
  require "google/cloud/discovery_engine/v1beta/document_service/rest"
21
23
  require "google/cloud/discovery_engine/v1beta/recommendation_service/rest"
22
24
  require "google/cloud/discovery_engine/v1beta/schema_service/rest"
23
- require "google/cloud/discovery_engine/v1beta/search_service/rest"
24
25
  require "google/cloud/discovery_engine/v1beta/user_event_service/rest"
25
26
  require "google/cloud/discovery_engine/v1beta/version"
26
27
 
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/discoveryengine/v1beta/schema_service_pb"
21
+ require "google/cloud/location"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -144,6 +145,12 @@ module Google
144
145
  config.endpoint = @config.endpoint
145
146
  end
146
147
 
148
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
149
+ config.credentials = credentials
150
+ config.quota_project = @quota_project_id
151
+ config.endpoint = @config.endpoint
152
+ end
153
+
147
154
  @schema_service_stub = ::Gapic::ServiceStub.new(
148
155
  ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Stub,
149
156
  credentials: credentials,
@@ -160,6 +167,13 @@ module Google
160
167
  #
161
168
  attr_reader :operations_client
162
169
 
170
+ ##
171
+ # Get the associated client for mix-in of the Locations.
172
+ #
173
+ # @return [Google::Cloud::Location::Locations::Client]
174
+ #
175
+ attr_reader :location_client
176
+
163
177
  # Service calls
164
178
 
165
179
  ##
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/discoveryengine/v1beta/schema_service_pb"
21
21
  require "google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -141,6 +142,12 @@ module Google
141
142
  config.endpoint = @config.endpoint
142
143
  end
143
144
 
145
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
146
+ config.credentials = credentials
147
+ config.quota_project = @quota_project_id
148
+ config.endpoint = @config.endpoint
149
+ end
150
+
144
151
  @schema_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
145
152
  end
146
153
 
@@ -151,6 +158,13 @@ module Google
151
158
  #
152
159
  attr_reader :operations_client
153
160
 
161
+ ##
162
+ # Get the associated client for mix-in of the Locations.
163
+ #
164
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
165
+ #
166
+ attr_reader :location_client
167
+
154
168
  # Service calls
155
169
 
156
170
  ##
@@ -734,6 +734,20 @@ module Google
734
734
  ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false]
735
735
  ]
736
736
  )
737
+ .with_bindings(
738
+ uri_method: :get,
739
+ uri_template: "/v1beta/{name}/operations",
740
+ matches: [
741
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false]
742
+ ]
743
+ )
744
+ .with_bindings(
745
+ uri_method: :get,
746
+ uri_template: "/v1beta/{name}/operations",
747
+ matches: [
748
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false]
749
+ ]
750
+ )
737
751
  .with_bindings(
738
752
  uri_method: :get,
739
753
  uri_template: "/v1beta/{name}/operations",
@@ -741,6 +755,13 @@ module Google
741
755
  ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false]
742
756
  ]
743
757
  )
758
+ .with_bindings(
759
+ uri_method: :get,
760
+ uri_template: "/v1beta/{name}/operations",
761
+ matches: [
762
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false]
763
+ ]
764
+ )
744
765
  .with_bindings(
745
766
  uri_method: :get,
746
767
  uri_template: "/v1beta/{name}/operations",
@@ -825,6 +846,27 @@ module Google
825
846
  ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false]
826
847
  ]
827
848
  )
849
+ .with_bindings(
850
+ uri_method: :get,
851
+ uri_template: "/v1beta/{name}",
852
+ matches: [
853
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false]
854
+ ]
855
+ )
856
+ .with_bindings(
857
+ uri_method: :get,
858
+ uri_template: "/v1beta/{name}",
859
+ matches: [
860
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false]
861
+ ]
862
+ )
863
+ .with_bindings(
864
+ uri_method: :get,
865
+ uri_template: "/v1beta/{name}",
866
+ matches: [
867
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false]
868
+ ]
869
+ )
828
870
  .with_bindings(
829
871
  uri_method: :get,
830
872
  uri_template: "/v1beta/{name}",
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/discoveryengine/v1beta/search_service_pb"
21
+ require "google/cloud/location"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -138,6 +139,12 @@ module Google
138
139
  @quota_project_id = @config.quota_project
139
140
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
140
141
 
142
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
143
+ config.credentials = credentials
144
+ config.quota_project = @quota_project_id
145
+ config.endpoint = @config.endpoint
146
+ end
147
+
141
148
  @search_service_stub = ::Gapic::ServiceStub.new(
142
149
  ::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Stub,
143
150
  credentials: credentials,
@@ -147,6 +154,13 @@ module Google
147
154
  )
148
155
  end
149
156
 
157
+ ##
158
+ # Get the associated client for mix-in of the Locations.
159
+ #
160
+ # @return [Google::Cloud::Location::Locations::Client]
161
+ #
162
+ attr_reader :location_client
163
+
150
164
  # Service calls
151
165
 
152
166
  ##
@@ -162,7 +176,7 @@ module Google
162
176
  # @param options [::Gapic::CallOptions, ::Hash]
163
177
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
164
178
  #
165
- # @overload search(serving_config: nil, branch: nil, query: nil, page_size: nil, page_token: nil, offset: nil, filter: nil, order_by: nil, user_info: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, safe_search: nil, user_labels: nil)
179
+ # @overload search(serving_config: nil, branch: nil, query: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, filter: nil, order_by: nil, user_info: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, embedding_spec: nil, ranking_expression: nil, safe_search: nil, user_labels: nil)
166
180
  # Pass arguments to `search` via keyword arguments. Note that at
167
181
  # least one keyword argument is required. To specify no parameters, or to keep all
168
182
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -180,10 +194,12 @@ module Google
180
194
  # documents under the default branch.
181
195
  # @param query [::String]
182
196
  # Raw search query.
197
+ # @param image_query [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ImageQuery, ::Hash]
198
+ # Raw image query.
183
199
  # @param page_size [::Integer]
184
200
  # Maximum number of {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s
185
201
  # to return. If unspecified, defaults to a reasonable value. The maximum
186
- # allowed value is 100. Values above 100 will be coerced to 100.
202
+ # allowed value is 100. Values above 100 are coerced to 100.
187
203
  #
188
204
  # If this field is negative, an `INVALID_ARGUMENT` is returned.
189
205
  # @param page_token [::String]
@@ -211,16 +227,17 @@ module Google
211
227
  #
212
228
  # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
213
229
  # @param order_by [::String]
214
- # The order in which documents are returned. Document can be ordered by
230
+ # The order in which documents are returned. Documents can be ordered by
215
231
  # a field in an {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}
216
- # object. Leave it unset if ordered by relevance. OrderBy expression is
232
+ # object. Leave it unset if ordered by relevance. `order_by` expression is
217
233
  # case-sensitive.
218
234
  #
219
- # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
235
+ # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
220
236
  # @param user_info [::Google::Cloud::DiscoveryEngine::V1beta::UserInfo, ::Hash]
221
237
  # Information about the end user.
222
- # Highly recommended for analytics. The user_agent string in UserInfo will
223
- # be used to deduce device_type for analytics.
238
+ # Highly recommended for analytics.
239
+ # {::Google::Cloud::DiscoveryEngine::V1beta::UserInfo#user_agent UserInfo.user_agent}
240
+ # is used to deduce `device_type` for analytics.
224
241
  # @param facet_specs [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec, ::Hash>]
225
242
  # Facet specifications for faceted search. If empty, no facets are returned.
226
243
  #
@@ -240,10 +257,10 @@ module Google
240
257
  # which enables image searching.
241
258
  # @param query_expansion_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec, ::Hash]
242
259
  # The query expansion specification that specifies the conditions under which
243
- # query expansion will occur.
260
+ # query expansion occurs.
244
261
  # @param spell_correction_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec, ::Hash]
245
262
  # The spell correction specification that specifies the mode under
246
- # which spell correction will take effect.
263
+ # which spell correction takes effect.
247
264
  # @param user_pseudo_id [::String]
248
265
  # A unique identifier for tracking visitors. For example, this could be
249
266
  # implemented with an HTTP cookie, which should be able to uniquely identify
@@ -260,11 +277,39 @@ module Google
260
277
  # The field must be a UTF-8 encoded string with a length limit of 128
261
278
  # characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
262
279
  # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec, ::Hash]
263
- # The content search spec that configs the desired behavior of content
264
- # search.
280
+ # A specification for configuring the behavior of content search.
281
+ # @param embedding_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec, ::Hash]
282
+ # Uses the provided embedding to do additional semantic document retrieval.
283
+ # The retrieval is based on the dot product of
284
+ # [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
285
+ # embedding that is provided in
286
+ # [SearchRequest.embedding_spec.embedding_vectors.field_path][].
287
+ #
288
+ # If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
289
+ # provided, it will use [ServingConfig.embedding_config.field_paths][].
290
+ # @param ranking_expression [::String]
291
+ # The ranking expression controls the customized ranking on retrieval
292
+ # documents. This overrides [ServingConfig.ranking_expression][].
293
+ # The ranking expression is a single function or multiple functions that are
294
+ # joint by "+".
295
+ # * ranking_expression = function, { " + ", function };
296
+ # Supported functions:
297
+ # * double * relevance_score
298
+ # * double * dotProduct(embedding_field_path)
299
+ # Function variables:
300
+ # `relevance_score`: pre-defined keywords, used for measure relevance
301
+ # between query and document.
302
+ # `embedding_field_path`: the document embedding field
303
+ # used with query embedding vector.
304
+ # `dotProduct`: embedding function between embedding_field_path and query
305
+ # embedding vector.
306
+ #
307
+ # Example ranking expression:
308
+ # If document has an embedding field doc_embedding, the ranking expression
309
+ # could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
265
310
  # @param safe_search [::Boolean]
266
311
  # Whether to turn on safe search. This is only supported for
267
- # [ContentConfig.PUBLIC_WEBSITE][].
312
+ # website search.
268
313
  # @param user_labels [::Hash{::String => ::String}]
269
314
  # The user labels applied to a resource must meet the following requirements:
270
315
  #
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/discoveryengine/v1beta/search_service_pb"
21
21
  require "google/cloud/discovery_engine/v1beta/search_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -135,9 +136,22 @@ module Google
135
136
  @quota_project_id = @config.quota_project
136
137
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
137
138
 
139
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
140
+ config.credentials = credentials
141
+ config.quota_project = @quota_project_id
142
+ config.endpoint = @config.endpoint
143
+ end
144
+
138
145
  @search_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
139
146
  end
140
147
 
148
+ ##
149
+ # Get the associated client for mix-in of the Locations.
150
+ #
151
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
152
+ #
153
+ attr_reader :location_client
154
+
141
155
  # Service calls
142
156
 
143
157
  ##
@@ -153,7 +167,7 @@ module Google
153
167
  # @param options [::Gapic::CallOptions, ::Hash]
154
168
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
155
169
  #
156
- # @overload search(serving_config: nil, branch: nil, query: nil, page_size: nil, page_token: nil, offset: nil, filter: nil, order_by: nil, user_info: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, safe_search: nil, user_labels: nil)
170
+ # @overload search(serving_config: nil, branch: nil, query: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, filter: nil, order_by: nil, user_info: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, embedding_spec: nil, ranking_expression: nil, safe_search: nil, user_labels: nil)
157
171
  # Pass arguments to `search` via keyword arguments. Note that at
158
172
  # least one keyword argument is required. To specify no parameters, or to keep all
159
173
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -171,10 +185,12 @@ module Google
171
185
  # documents under the default branch.
172
186
  # @param query [::String]
173
187
  # Raw search query.
188
+ # @param image_query [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ImageQuery, ::Hash]
189
+ # Raw image query.
174
190
  # @param page_size [::Integer]
175
191
  # Maximum number of {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s
176
192
  # to return. If unspecified, defaults to a reasonable value. The maximum
177
- # allowed value is 100. Values above 100 will be coerced to 100.
193
+ # allowed value is 100. Values above 100 are coerced to 100.
178
194
  #
179
195
  # If this field is negative, an `INVALID_ARGUMENT` is returned.
180
196
  # @param page_token [::String]
@@ -202,16 +218,17 @@ module Google
202
218
  #
203
219
  # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
204
220
  # @param order_by [::String]
205
- # The order in which documents are returned. Document can be ordered by
221
+ # The order in which documents are returned. Documents can be ordered by
206
222
  # a field in an {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}
207
- # object. Leave it unset if ordered by relevance. OrderBy expression is
223
+ # object. Leave it unset if ordered by relevance. `order_by` expression is
208
224
  # case-sensitive.
209
225
  #
210
- # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
226
+ # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
211
227
  # @param user_info [::Google::Cloud::DiscoveryEngine::V1beta::UserInfo, ::Hash]
212
228
  # Information about the end user.
213
- # Highly recommended for analytics. The user_agent string in UserInfo will
214
- # be used to deduce device_type for analytics.
229
+ # Highly recommended for analytics.
230
+ # {::Google::Cloud::DiscoveryEngine::V1beta::UserInfo#user_agent UserInfo.user_agent}
231
+ # is used to deduce `device_type` for analytics.
215
232
  # @param facet_specs [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec, ::Hash>]
216
233
  # Facet specifications for faceted search. If empty, no facets are returned.
217
234
  #
@@ -231,10 +248,10 @@ module Google
231
248
  # which enables image searching.
232
249
  # @param query_expansion_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec, ::Hash]
233
250
  # The query expansion specification that specifies the conditions under which
234
- # query expansion will occur.
251
+ # query expansion occurs.
235
252
  # @param spell_correction_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec, ::Hash]
236
253
  # The spell correction specification that specifies the mode under
237
- # which spell correction will take effect.
254
+ # which spell correction takes effect.
238
255
  # @param user_pseudo_id [::String]
239
256
  # A unique identifier for tracking visitors. For example, this could be
240
257
  # implemented with an HTTP cookie, which should be able to uniquely identify
@@ -251,11 +268,39 @@ module Google
251
268
  # The field must be a UTF-8 encoded string with a length limit of 128
252
269
  # characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
253
270
  # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec, ::Hash]
254
- # The content search spec that configs the desired behavior of content
255
- # search.
271
+ # A specification for configuring the behavior of content search.
272
+ # @param embedding_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec, ::Hash]
273
+ # Uses the provided embedding to do additional semantic document retrieval.
274
+ # The retrieval is based on the dot product of
275
+ # [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
276
+ # embedding that is provided in
277
+ # [SearchRequest.embedding_spec.embedding_vectors.field_path][].
278
+ #
279
+ # If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
280
+ # provided, it will use [ServingConfig.embedding_config.field_paths][].
281
+ # @param ranking_expression [::String]
282
+ # The ranking expression controls the customized ranking on retrieval
283
+ # documents. This overrides [ServingConfig.ranking_expression][].
284
+ # The ranking expression is a single function or multiple functions that are
285
+ # joint by "+".
286
+ # * ranking_expression = function, { " + ", function };
287
+ # Supported functions:
288
+ # * double * relevance_score
289
+ # * double * dotProduct(embedding_field_path)
290
+ # Function variables:
291
+ # `relevance_score`: pre-defined keywords, used for measure relevance
292
+ # between query and document.
293
+ # `embedding_field_path`: the document embedding field
294
+ # used with query embedding vector.
295
+ # `dotProduct`: embedding function between embedding_field_path and query
296
+ # embedding vector.
297
+ #
298
+ # Example ranking expression:
299
+ # If document has an embedding field doc_embedding, the ranking expression
300
+ # could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
256
301
  # @param safe_search [::Boolean]
257
302
  # Whether to turn on safe search. This is only supported for
258
- # [ContentConfig.PUBLIC_WEBSITE][].
303
+ # website search.
259
304
  # @param user_labels [::Hash{::String => ::String}]
260
305
  # The user labels applied to a resource must meet the following requirements:
261
306
  #