google-cloud-discovery_engine-v1beta 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +742 -0
  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 +693 -0
  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/document_service/client.rb +48 -23
  7. data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +21 -0
  8. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +48 -23
  9. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +296 -0
  10. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +275 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/service_stub.rb +180 -0
  12. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb +449 -0
  13. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/credentials.rb +47 -0
  14. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/paths.rb +52 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/client.rb +416 -0
  16. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/service_stub.rb +129 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest.rb +52 -0
  18. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service.rb +55 -0
  19. data/lib/google/cloud/discovery_engine/v1beta/rank_service/client.rb +459 -0
  20. data/lib/google/cloud/discovery_engine/v1beta/rank_service/credentials.rb +47 -0
  21. data/lib/google/cloud/discovery_engine/v1beta/rank_service/paths.rb +52 -0
  22. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/client.rb +426 -0
  23. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/service_stub.rb +129 -0
  24. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest.rb +52 -0
  25. data/lib/google/cloud/discovery_engine/v1beta/rank_service.rb +55 -0
  26. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +2 -0
  27. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +11 -6
  28. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +11 -6
  29. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  30. data/lib/google/cloud/discovery_engine/v1beta.rb +2 -0
  31. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +67 -0
  32. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +1 -1
  33. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +32 -1
  34. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_services_pb.rb +25 -0
  35. data/lib/google/cloud/discoveryengine/v1beta/document_processing_config_pb.rb +1 -1
  36. data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +3 -1
  37. data/lib/google/cloud/discoveryengine/v1beta/engine_service_pb.rb +6 -1
  38. data/lib/google/cloud/discoveryengine/v1beta/engine_service_services_pb.rb +12 -0
  39. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_pb.rb +52 -0
  40. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_services_pb.rb +45 -0
  41. data/lib/google/cloud/discoveryengine/v1beta/grounding_pb.rb +46 -0
  42. data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +13 -1
  43. data/lib/google/cloud/discoveryengine/v1beta/rank_service_pb.rb +49 -0
  44. data/lib/google/cloud/discoveryengine/v1beta/rank_service_services_pb.rb +45 -0
  45. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +7 -1
  46. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_pb.rb +1 -1
  47. data/lib/google/cloud/discoveryengine/v1beta/session_pb.rb +50 -0
  48. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +354 -0
  49. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +9 -1
  50. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +475 -0
  51. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +3 -5
  52. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +4 -0
  53. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +2 -2
  54. data/proto_docs/google/cloud/discoveryengine/v1beta/engine_service.rb +51 -0
  55. data/proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb +106 -0
  56. data/proto_docs/google/cloud/discoveryengine/v1beta/grounding.rb +76 -0
  57. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +310 -24
  58. data/proto_docs/google/cloud/discoveryengine/v1beta/rank_service.rb +99 -0
  59. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +154 -22
  60. data/proto_docs/google/cloud/discoveryengine/v1beta/search_tuning_service.rb +16 -1
  61. data/proto_docs/google/cloud/discoveryengine/v1beta/session.rb +85 -0
  62. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +1 -1
  63. metadata +28 -2
@@ -0,0 +1,449 @@
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
+ require "google/cloud/errors"
20
+ require "google/cloud/discoveryengine/v1beta/grounded_generation_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module DiscoveryEngine
26
+ module V1beta
27
+ module GroundedGenerationService
28
+ ##
29
+ # Client for the GroundedGenerationService service.
30
+ #
31
+ # Service for grounded generation.
32
+ #
33
+ class Client
34
+ # @private
35
+ DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
36
+
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :grounded_generation_service_stub
41
+
42
+ ##
43
+ # Configure the GroundedGenerationService Client class.
44
+ #
45
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all GroundedGenerationService clients
51
+ # ::Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "DiscoveryEngine", "V1beta"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.timeout = 5.0
72
+ default_config.retry_policy = {
73
+ initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14]
74
+ }
75
+
76
+ default_config
77
+ end
78
+ yield @configure if block_given?
79
+ @configure
80
+ end
81
+
82
+ ##
83
+ # Configure the GroundedGenerationService Client instance.
84
+ #
85
+ # The configuration is set to the derived mode, meaning that values can be changed,
86
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
87
+ # should be made on {Client.configure}.
88
+ #
89
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Client::Configuration}
90
+ # for a description of the configuration fields.
91
+ #
92
+ # @yield [config] Configure the Client client.
93
+ # @yieldparam config [Client::Configuration]
94
+ #
95
+ # @return [Client::Configuration]
96
+ #
97
+ def configure
98
+ yield @config if block_given?
99
+ @config
100
+ end
101
+
102
+ ##
103
+ # The effective universe domain
104
+ #
105
+ # @return [String]
106
+ #
107
+ def universe_domain
108
+ @grounded_generation_service_stub.universe_domain
109
+ end
110
+
111
+ ##
112
+ # Create a new GroundedGenerationService client object.
113
+ #
114
+ # @example
115
+ #
116
+ # # Create a client using the default configuration
117
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Client.new
118
+ #
119
+ # # Create a client using a custom configuration
120
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Client.new do |config|
121
+ # config.timeout = 10.0
122
+ # end
123
+ #
124
+ # @yield [config] Configure the GroundedGenerationService client.
125
+ # @yieldparam config [Client::Configuration]
126
+ #
127
+ def initialize
128
+ # These require statements are intentionally placed here to initialize
129
+ # the gRPC module only when it's required.
130
+ # See https://github.com/googleapis/toolkit/issues/446
131
+ require "gapic/grpc"
132
+ require "google/cloud/discoveryengine/v1beta/grounded_generation_service_services_pb"
133
+
134
+ # Create the configuration object
135
+ @config = Configuration.new Client.configure
136
+
137
+ # Yield the configuration if needed
138
+ yield @config if block_given?
139
+
140
+ # Create credentials
141
+ credentials = @config.credentials
142
+ # Use self-signed JWT if the endpoint is unchanged from default,
143
+ # but only if the default endpoint does not have a region prefix.
144
+ enable_self_signed_jwt = @config.endpoint.nil? ||
145
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
146
+ !@config.endpoint.split(".").first.include?("-"))
147
+ credentials ||= Credentials.default scope: @config.scope,
148
+ enable_self_signed_jwt: enable_self_signed_jwt
149
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
150
+ credentials = Credentials.new credentials, scope: @config.scope
151
+ end
152
+ @quota_project_id = @config.quota_project
153
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
154
+
155
+ @grounded_generation_service_stub = ::Gapic::ServiceStub.new(
156
+ ::Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Stub,
157
+ credentials: credentials,
158
+ endpoint: @config.endpoint,
159
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
160
+ universe_domain: @config.universe_domain,
161
+ channel_args: @config.channel_args,
162
+ interceptors: @config.interceptors,
163
+ channel_pool_config: @config.channel_pool
164
+ )
165
+
166
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
167
+ config.credentials = credentials
168
+ config.quota_project = @quota_project_id
169
+ config.endpoint = @grounded_generation_service_stub.endpoint
170
+ config.universe_domain = @grounded_generation_service_stub.universe_domain
171
+ end
172
+ end
173
+
174
+ ##
175
+ # Get the associated client for mix-in of the Locations.
176
+ #
177
+ # @return [Google::Cloud::Location::Locations::Client]
178
+ #
179
+ attr_reader :location_client
180
+
181
+ # Service calls
182
+
183
+ ##
184
+ # Performs a grounding check.
185
+ #
186
+ # @overload check_grounding(request, options = nil)
187
+ # Pass arguments to `check_grounding` via a request object, either of type
188
+ # {::Google::Cloud::DiscoveryEngine::V1beta::CheckGroundingRequest} or an equivalent Hash.
189
+ #
190
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::CheckGroundingRequest, ::Hash]
191
+ # A request object representing the call parameters. Required. To specify no
192
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
193
+ # @param options [::Gapic::CallOptions, ::Hash]
194
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
195
+ #
196
+ # @overload check_grounding(grounding_config: nil, answer_candidate: nil, facts: nil, grounding_spec: nil)
197
+ # Pass arguments to `check_grounding` via keyword arguments. Note that at
198
+ # least one keyword argument is required. To specify no parameters, or to keep all
199
+ # the default parameter values, pass an empty Hash as a request object (see above).
200
+ #
201
+ # @param grounding_config [::String]
202
+ # Required. The resource name of the grounding config, such as
203
+ # `projects/*/locations/global/groundingConfigs/default_grounding_config`.
204
+ # @param answer_candidate [::String]
205
+ # Answer candidate to check.
206
+ # @param facts [::Array<::Google::Cloud::DiscoveryEngine::V1beta::GroundingFact, ::Hash>]
207
+ # List of facts for the grounding check.
208
+ # We support up to 200 facts.
209
+ # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1beta::CheckGroundingSpec, ::Hash]
210
+ # Configuration of the grounding check.
211
+ #
212
+ # @yield [response, operation] Access the result along with the RPC operation
213
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::CheckGroundingResponse]
214
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
215
+ #
216
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::CheckGroundingResponse]
217
+ #
218
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
219
+ #
220
+ # @example Basic example
221
+ # require "google/cloud/discovery_engine/v1beta"
222
+ #
223
+ # # Create a client object. The client can be reused for multiple calls.
224
+ # client = Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Client.new
225
+ #
226
+ # # Create a request. To set request fields, pass in keyword arguments.
227
+ # request = Google::Cloud::DiscoveryEngine::V1beta::CheckGroundingRequest.new
228
+ #
229
+ # # Call the check_grounding method.
230
+ # result = client.check_grounding request
231
+ #
232
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::CheckGroundingResponse.
233
+ # p result
234
+ #
235
+ def check_grounding request, options = nil
236
+ raise ::ArgumentError, "request must be provided" if request.nil?
237
+
238
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::CheckGroundingRequest
239
+
240
+ # Converts hash and nil to an options object
241
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
242
+
243
+ # Customize the options with defaults
244
+ metadata = @config.rpcs.check_grounding.metadata.to_h
245
+
246
+ # Set x-goog-api-client and x-goog-user-project headers
247
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
248
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
249
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
250
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
251
+
252
+ header_params = {}
253
+ if request.grounding_config
254
+ header_params["grounding_config"] = request.grounding_config
255
+ end
256
+
257
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
258
+ metadata[:"x-goog-request-params"] ||= request_params_header
259
+
260
+ options.apply_defaults timeout: @config.rpcs.check_grounding.timeout,
261
+ metadata: metadata,
262
+ retry_policy: @config.rpcs.check_grounding.retry_policy
263
+
264
+ options.apply_defaults timeout: @config.timeout,
265
+ metadata: @config.metadata,
266
+ retry_policy: @config.retry_policy
267
+
268
+ @grounded_generation_service_stub.call_rpc :check_grounding, request, options: options do |response, operation|
269
+ yield response, operation if block_given?
270
+ return response
271
+ end
272
+ rescue ::GRPC::BadStatus => e
273
+ raise ::Google::Cloud::Error.from_error(e)
274
+ end
275
+
276
+ ##
277
+ # Configuration class for the GroundedGenerationService API.
278
+ #
279
+ # This class represents the configuration for GroundedGenerationService,
280
+ # providing control over timeouts, retry behavior, logging, transport
281
+ # parameters, and other low-level controls. Certain parameters can also be
282
+ # applied individually to specific RPCs. See
283
+ # {::Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Client::Configuration::Rpcs}
284
+ # for a list of RPCs that can be configured independently.
285
+ #
286
+ # Configuration can be applied globally to all clients, or to a single client
287
+ # on construction.
288
+ #
289
+ # @example
290
+ #
291
+ # # Modify the global config, setting the timeout for
292
+ # # check_grounding to 20 seconds,
293
+ # # and all remaining timeouts to 10 seconds.
294
+ # ::Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Client.configure do |config|
295
+ # config.timeout = 10.0
296
+ # config.rpcs.check_grounding.timeout = 20.0
297
+ # end
298
+ #
299
+ # # Apply the above configuration only to a new client.
300
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Client.new do |config|
301
+ # config.timeout = 10.0
302
+ # config.rpcs.check_grounding.timeout = 20.0
303
+ # end
304
+ #
305
+ # @!attribute [rw] endpoint
306
+ # A custom service endpoint, as a hostname or hostname:port. The default is
307
+ # nil, indicating to use the default endpoint in the current universe domain.
308
+ # @return [::String,nil]
309
+ # @!attribute [rw] credentials
310
+ # Credentials to send with calls. You may provide any of the following types:
311
+ # * (`String`) The path to a service account key file in JSON format
312
+ # * (`Hash`) A service account key as a Hash
313
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
314
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
315
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
316
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
317
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
318
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
319
+ # * (`nil`) indicating no credentials
320
+ # @return [::Object]
321
+ # @!attribute [rw] scope
322
+ # The OAuth scopes
323
+ # @return [::Array<::String>]
324
+ # @!attribute [rw] lib_name
325
+ # The library name as recorded in instrumentation and logging
326
+ # @return [::String]
327
+ # @!attribute [rw] lib_version
328
+ # The library version as recorded in instrumentation and logging
329
+ # @return [::String]
330
+ # @!attribute [rw] channel_args
331
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
332
+ # `GRPC::Core::Channel` object is provided as the credential.
333
+ # @return [::Hash]
334
+ # @!attribute [rw] interceptors
335
+ # An array of interceptors that are run before calls are executed.
336
+ # @return [::Array<::GRPC::ClientInterceptor>]
337
+ # @!attribute [rw] timeout
338
+ # The call timeout in seconds.
339
+ # @return [::Numeric]
340
+ # @!attribute [rw] metadata
341
+ # Additional gRPC headers to be sent with the call.
342
+ # @return [::Hash{::Symbol=>::String}]
343
+ # @!attribute [rw] retry_policy
344
+ # The retry policy. The value is a hash with the following keys:
345
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
346
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
347
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
348
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
349
+ # trigger a retry.
350
+ # @return [::Hash]
351
+ # @!attribute [rw] quota_project
352
+ # A separate project against which to charge quota.
353
+ # @return [::String]
354
+ # @!attribute [rw] universe_domain
355
+ # The universe domain within which to make requests. This determines the
356
+ # default endpoint URL. The default value of nil uses the environment
357
+ # universe (usually the default "googleapis.com" universe).
358
+ # @return [::String,nil]
359
+ #
360
+ class Configuration
361
+ extend ::Gapic::Config
362
+
363
+ # @private
364
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
365
+ DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
366
+
367
+ config_attr :endpoint, nil, ::String, nil
368
+ config_attr :credentials, nil do |value|
369
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
370
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
371
+ allowed.any? { |klass| klass === value }
372
+ end
373
+ config_attr :scope, nil, ::String, ::Array, nil
374
+ config_attr :lib_name, nil, ::String, nil
375
+ config_attr :lib_version, nil, ::String, nil
376
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
377
+ config_attr :interceptors, nil, ::Array, nil
378
+ config_attr :timeout, nil, ::Numeric, nil
379
+ config_attr :metadata, nil, ::Hash, nil
380
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
381
+ config_attr :quota_project, nil, ::String, nil
382
+ config_attr :universe_domain, nil, ::String, nil
383
+
384
+ # @private
385
+ def initialize parent_config = nil
386
+ @parent_config = parent_config unless parent_config.nil?
387
+
388
+ yield self if block_given?
389
+ end
390
+
391
+ ##
392
+ # Configurations for individual RPCs
393
+ # @return [Rpcs]
394
+ #
395
+ def rpcs
396
+ @rpcs ||= begin
397
+ parent_rpcs = nil
398
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
399
+ Rpcs.new parent_rpcs
400
+ end
401
+ end
402
+
403
+ ##
404
+ # Configuration for the channel pool
405
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
406
+ #
407
+ def channel_pool
408
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
409
+ end
410
+
411
+ ##
412
+ # Configuration RPC class for the GroundedGenerationService API.
413
+ #
414
+ # Includes fields providing the configuration for each RPC in this service.
415
+ # Each configuration object is of type `Gapic::Config::Method` and includes
416
+ # the following configuration fields:
417
+ #
418
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
419
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
420
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
421
+ # include the following keys:
422
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
423
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
424
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
425
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
426
+ # trigger a retry.
427
+ #
428
+ class Rpcs
429
+ ##
430
+ # RPC-specific configuration for `check_grounding`
431
+ # @return [::Gapic::Config::Method]
432
+ #
433
+ attr_reader :check_grounding
434
+
435
+ # @private
436
+ def initialize parent_rpcs = nil
437
+ check_grounding_config = parent_rpcs.check_grounding if parent_rpcs.respond_to? :check_grounding
438
+ @check_grounding = ::Gapic::Config::Method.new check_grounding_config
439
+
440
+ yield self if block_given?
441
+ end
442
+ end
443
+ end
444
+ end
445
+ end
446
+ end
447
+ end
448
+ end
449
+ end
@@ -0,0 +1,47 @@
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
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module DiscoveryEngine
24
+ module V1beta
25
+ module GroundedGenerationService
26
+ # Credentials for the GroundedGenerationService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "GOOGLE_CLOUD_CREDENTIALS",
33
+ "GOOGLE_CLOUD_KEYFILE",
34
+ "GCLOUD_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
36
+ "GOOGLE_CLOUD_KEYFILE_JSON",
37
+ "GCLOUD_KEYFILE_JSON"
38
+ ]
39
+ self.paths = [
40
+ "~/.config/google_cloud/application_default_credentials.json"
41
+ ]
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,52 @@
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
+ module GroundedGenerationService
25
+ # Path helper methods for the GroundedGenerationService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified GroundingConfig resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/groundingConfigs/{grounding_config}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param grounding_config [String]
37
+ #
38
+ # @return [::String]
39
+ def grounding_config_path project:, location:, grounding_config:
40
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
41
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
42
+
43
+ "projects/#{project}/locations/#{location}/groundingConfigs/#{grounding_config}"
44
+ end
45
+
46
+ extend self
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end