google-cloud-ai_platform-v1 1.15.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb +137 -0
- data/lib/google/cloud/ai_platform/v1/model_garden_service/operations.rb +821 -0
- data/lib/google/cloud/ai_platform/v1/model_garden_service/paths.rb +36 -0
- data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/client.rb +130 -0
- data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/operations.rb +4398 -0
- data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/service_stub.rb +62 -0
- data/lib/google/cloud/ai_platform/v1/model_garden_service/rest.rb +1 -0
- data/lib/google/cloud/ai_platform/v1/model_garden_service.rb +1 -0
- data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/client.rb +198 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb +17 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/client.rb +184 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/service_stub.rb +123 -0
- data/lib/google/cloud/aiplatform/v1/endpoint_pb.rb +3 -1
- data/lib/google/cloud/aiplatform/v1/model_garden_service_pb.rb +14 -1
- data/lib/google/cloud/aiplatform/v1/model_garden_service_services_pb.rb +2 -0
- data/lib/google/cloud/aiplatform/v1/service_networking_pb.rb +3 -1
- data/lib/google/cloud/aiplatform/v1/vertex_rag_data_pb.rb +6 -1
- data/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_pb.rb +4 -1
- data/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_services_pb.rb +4 -0
- data/proto_docs/google/cloud/aiplatform/v1/endpoint.rb +31 -6
- data/proto_docs/google/cloud/aiplatform/v1/model_garden_service.rb +153 -0
- data/proto_docs/google/cloud/aiplatform/v1/service_networking.rb +61 -5
- data/proto_docs/google/cloud/aiplatform/v1/vertex_rag_data.rb +67 -0
- data/proto_docs/google/cloud/aiplatform/v1/vertex_rag_data_service.rb +35 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48215fb7157d8fe8cefbc130ace576c649d2f919aa6037f77720c4055ec58961
|
4
|
+
data.tar.gz: f1fb5d1cd35c6dfea61af093daf6fb31cfb818304247b650e23724239c56b1cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08ac444312daefd5c8f36f476ad935b94b432514c6b448d7d7290953f51243c0425db11d2258bb40eeadd59bf118ff9bf5a6906b9f6eed54931f82f28f9d1d73'
|
7
|
+
data.tar.gz: 5eba79765efd6fe4ca33185092ee96890eaf953b0dadb92841907cc45d08d396c9c6bba727cd0279ce7e0816f2f657f0ad14e9e68e5b1559d05dd84faadd971a
|
@@ -151,6 +151,13 @@ module Google
|
|
151
151
|
@quota_project_id = @config.quota_project
|
152
152
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
153
153
|
|
154
|
+
@operations_client = Operations.new do |config|
|
155
|
+
config.credentials = credentials
|
156
|
+
config.quota_project = @quota_project_id
|
157
|
+
config.endpoint = @config.endpoint
|
158
|
+
config.universe_domain = @config.universe_domain
|
159
|
+
end
|
160
|
+
|
154
161
|
@model_garden_service_stub = ::Gapic::ServiceStub.new(
|
155
162
|
::Google::Cloud::AIPlatform::V1::ModelGardenService::Stub,
|
156
163
|
credentials: credentials,
|
@@ -190,6 +197,13 @@ module Google
|
|
190
197
|
end
|
191
198
|
end
|
192
199
|
|
200
|
+
##
|
201
|
+
# Get the associated client for long-running operations.
|
202
|
+
#
|
203
|
+
# @return [::Google::Cloud::AIPlatform::V1::ModelGardenService::Operations]
|
204
|
+
#
|
205
|
+
attr_reader :operations_client
|
206
|
+
|
193
207
|
##
|
194
208
|
# Get the associated client for mix-in of the Locations.
|
195
209
|
#
|
@@ -312,6 +326,122 @@ module Google
|
|
312
326
|
raise ::Google::Cloud::Error.from_error(e)
|
313
327
|
end
|
314
328
|
|
329
|
+
##
|
330
|
+
# Deploys a model to a new endpoint.
|
331
|
+
#
|
332
|
+
# @overload deploy(request, options = nil)
|
333
|
+
# Pass arguments to `deploy` via a request object, either of type
|
334
|
+
# {::Google::Cloud::AIPlatform::V1::DeployRequest} or an equivalent Hash.
|
335
|
+
#
|
336
|
+
# @param request [::Google::Cloud::AIPlatform::V1::DeployRequest, ::Hash]
|
337
|
+
# A request object representing the call parameters. Required. To specify no
|
338
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
339
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
340
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
341
|
+
#
|
342
|
+
# @overload deploy(publisher_model_name: nil, hugging_face_model_id: nil, destination: nil, model_config: nil, endpoint_config: nil, deploy_config: nil)
|
343
|
+
# Pass arguments to `deploy` via keyword arguments. Note that at
|
344
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
345
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
346
|
+
#
|
347
|
+
# @param publisher_model_name [::String]
|
348
|
+
# The Model Garden model to deploy.
|
349
|
+
# Format:
|
350
|
+
# `publishers/{publisher}/models/{publisher_model}@{version_id}`, or
|
351
|
+
# `publishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001`.
|
352
|
+
#
|
353
|
+
# Note: The following fields are mutually exclusive: `publisher_model_name`, `hugging_face_model_id`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
354
|
+
# @param hugging_face_model_id [::String]
|
355
|
+
# The Hugging Face model to deploy.
|
356
|
+
# Format: Hugging Face model ID like `google/gemma-2-2b-it`.
|
357
|
+
#
|
358
|
+
# Note: The following fields are mutually exclusive: `hugging_face_model_id`, `publisher_model_name`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
359
|
+
# @param destination [::String]
|
360
|
+
# Required. The resource name of the Location to deploy the model in.
|
361
|
+
# Format: `projects/{project}/locations/{location}`
|
362
|
+
# @param model_config [::Google::Cloud::AIPlatform::V1::DeployRequest::ModelConfig, ::Hash]
|
363
|
+
# Optional. The model config to use for the deployment.
|
364
|
+
# If not specified, the default model config will be used.
|
365
|
+
# @param endpoint_config [::Google::Cloud::AIPlatform::V1::DeployRequest::EndpointConfig, ::Hash]
|
366
|
+
# Optional. The endpoint config to use for the deployment.
|
367
|
+
# If not specified, the default endpoint config will be used.
|
368
|
+
# @param deploy_config [::Google::Cloud::AIPlatform::V1::DeployRequest::DeployConfig, ::Hash]
|
369
|
+
# Optional. The deploy config to use for the deployment.
|
370
|
+
# If not specified, the default deploy config will be used.
|
371
|
+
#
|
372
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
373
|
+
# @yieldparam response [::Gapic::Operation]
|
374
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
375
|
+
#
|
376
|
+
# @return [::Gapic::Operation]
|
377
|
+
#
|
378
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
379
|
+
#
|
380
|
+
# @example Basic example
|
381
|
+
# require "google/cloud/ai_platform/v1"
|
382
|
+
#
|
383
|
+
# # Create a client object. The client can be reused for multiple calls.
|
384
|
+
# client = Google::Cloud::AIPlatform::V1::ModelGardenService::Client.new
|
385
|
+
#
|
386
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
387
|
+
# request = Google::Cloud::AIPlatform::V1::DeployRequest.new
|
388
|
+
#
|
389
|
+
# # Call the deploy method.
|
390
|
+
# result = client.deploy request
|
391
|
+
#
|
392
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
393
|
+
# # check the status of an operation, cancel it, or wait for results.
|
394
|
+
# # Here is how to wait for a response.
|
395
|
+
# result.wait_until_done! timeout: 60
|
396
|
+
# if result.response?
|
397
|
+
# p result.response
|
398
|
+
# else
|
399
|
+
# puts "No response received."
|
400
|
+
# end
|
401
|
+
#
|
402
|
+
def deploy request, options = nil
|
403
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
404
|
+
|
405
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeployRequest
|
406
|
+
|
407
|
+
# Converts hash and nil to an options object
|
408
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
409
|
+
|
410
|
+
# Customize the options with defaults
|
411
|
+
metadata = @config.rpcs.deploy.metadata.to_h
|
412
|
+
|
413
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
414
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
415
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
416
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
417
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
418
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
419
|
+
|
420
|
+
header_params = {}
|
421
|
+
if request.destination
|
422
|
+
header_params["destination"] = request.destination
|
423
|
+
end
|
424
|
+
|
425
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
426
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
427
|
+
|
428
|
+
options.apply_defaults timeout: @config.rpcs.deploy.timeout,
|
429
|
+
metadata: metadata,
|
430
|
+
retry_policy: @config.rpcs.deploy.retry_policy
|
431
|
+
|
432
|
+
options.apply_defaults timeout: @config.timeout,
|
433
|
+
metadata: @config.metadata,
|
434
|
+
retry_policy: @config.retry_policy
|
435
|
+
|
436
|
+
@model_garden_service_stub.call_rpc :deploy, request, options: options do |response, operation|
|
437
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
438
|
+
yield response, operation if block_given?
|
439
|
+
throw :response, response
|
440
|
+
end
|
441
|
+
rescue ::GRPC::BadStatus => e
|
442
|
+
raise ::Google::Cloud::Error.from_error(e)
|
443
|
+
end
|
444
|
+
|
315
445
|
##
|
316
446
|
# Configuration class for the ModelGardenService API.
|
317
447
|
#
|
@@ -483,11 +613,18 @@ module Google
|
|
483
613
|
# @return [::Gapic::Config::Method]
|
484
614
|
#
|
485
615
|
attr_reader :get_publisher_model
|
616
|
+
##
|
617
|
+
# RPC-specific configuration for `deploy`
|
618
|
+
# @return [::Gapic::Config::Method]
|
619
|
+
#
|
620
|
+
attr_reader :deploy
|
486
621
|
|
487
622
|
# @private
|
488
623
|
def initialize parent_rpcs = nil
|
489
624
|
get_publisher_model_config = parent_rpcs.get_publisher_model if parent_rpcs.respond_to? :get_publisher_model
|
490
625
|
@get_publisher_model = ::Gapic::Config::Method.new get_publisher_model_config
|
626
|
+
deploy_config = parent_rpcs.deploy if parent_rpcs.respond_to? :deploy
|
627
|
+
@deploy = ::Gapic::Config::Method.new deploy_config
|
491
628
|
|
492
629
|
yield self if block_given?
|
493
630
|
end
|