google-cloud-ai_platform-v1 0.52.0 → 0.53.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed634c25b7d38f217e4203d6bd7822491e47c4a8283c5c6b6dce4edf4e4051a2
4
- data.tar.gz: 955200e93934c1b2b53a51f1e9a44fac10f5c95dd59ea5eddb26803c582f5ff1
3
+ metadata.gz: d09d9bb75fb78c88c5c5c3574e6d1e680af66aa7b0446c285b809b6b839f9851
4
+ data.tar.gz: 10310f10cff95a6d5a74d097d737daa2697d029c017f3c5bd5b7301a4cfb021c
5
5
  SHA512:
6
- metadata.gz: 22309463ac8b9a3f7ccba19e138efc9a37c5ae2ae7b059817bbc9432fdeec79c3d9aa949db293d05fc42df460fa36a4a61b36b2d29a52d3b3b74fdcfecc24042
7
- data.tar.gz: 99b0898dd474cd953c9a9f20a899cbe5671b365f87aa69a36795c0fcc52836fa873f4215bb0a58020c45050d77a00990b5f9b823ae56c6c86a2b5a1fe42583b8
6
+ metadata.gz: 1eee970f1c94d6b4ba4623a11aa44ec941b5023da806192d3acf40433ad841c89c315b35d3a4a661ee26669d425ed3fc410e2eea83cdf373c4a588c68ba1a3fa
7
+ data.tar.gz: 1253b3f3bd8cb6a2a665f9b8d425e17749ae50002930dc06d0a7a31aab53e4d179056d604ff41f40e66fbee3b6a0767fe8c2770bc09a669adbe3063115824e98
@@ -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
  @gen_ai_tuning_service_stub = ::Gapic::ServiceStub.new(
155
162
  ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Stub,
156
163
  credentials: credentials,
@@ -177,6 +184,13 @@ module Google
177
184
  end
178
185
  end
179
186
 
187
+ ##
188
+ # Get the associated client for long-running operations.
189
+ #
190
+ # @return [::Google::Cloud::AIPlatform::V1::GenAiTuningService::Operations]
191
+ #
192
+ attr_reader :operations_client
193
+
180
194
  ##
181
195
  # Get the associated client for mix-in of the Locations.
182
196
  #
@@ -568,6 +582,114 @@ module Google
568
582
  raise ::Google::Cloud::Error.from_error(e)
569
583
  end
570
584
 
585
+ ##
586
+ # Rebase a TunedModel.
587
+ # Creates a LongRunningOperation that takes a legacy Tuned GenAI model
588
+ # Reference and creates a TuningJob based on newly available model.
589
+ #
590
+ # @overload rebase_tuned_model(request, options = nil)
591
+ # Pass arguments to `rebase_tuned_model` via a request object, either of type
592
+ # {::Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest} or an equivalent Hash.
593
+ #
594
+ # @param request [::Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest, ::Hash]
595
+ # A request object representing the call parameters. Required. To specify no
596
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
597
+ # @param options [::Gapic::CallOptions, ::Hash]
598
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
599
+ #
600
+ # @overload rebase_tuned_model(parent: nil, tuned_model_ref: nil, tuning_job: nil, artifact_destination: nil, deploy_to_same_endpoint: nil)
601
+ # Pass arguments to `rebase_tuned_model` via keyword arguments. Note that at
602
+ # least one keyword argument is required. To specify no parameters, or to keep all
603
+ # the default parameter values, pass an empty Hash as a request object (see above).
604
+ #
605
+ # @param parent [::String]
606
+ # Required. The resource name of the Location into which to rebase the Model.
607
+ # Format: `projects/{project}/locations/{location}`
608
+ # @param tuned_model_ref [::Google::Cloud::AIPlatform::V1::TunedModelRef, ::Hash]
609
+ # Required. TunedModel reference to retrieve the legacy model information.
610
+ # @param tuning_job [::Google::Cloud::AIPlatform::V1::TuningJob, ::Hash]
611
+ # Optional. The TuningJob to be updated. Users can use this TuningJob field
612
+ # to overwrite tuning configs.
613
+ # @param artifact_destination [::Google::Cloud::AIPlatform::V1::GcsDestination, ::Hash]
614
+ # Optional. The Google Cloud Storage location to write the artifacts.
615
+ # @param deploy_to_same_endpoint [::Boolean]
616
+ # Optional. By default, bison to gemini migration will always create new
617
+ # model/endpoint, but for gemini-1.0 to gemini-1.5 migration, we default
618
+ # deploy to the same endpoint. See details in this Section.
619
+ #
620
+ # @yield [response, operation] Access the result along with the RPC operation
621
+ # @yieldparam response [::Gapic::Operation]
622
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
623
+ #
624
+ # @return [::Gapic::Operation]
625
+ #
626
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
627
+ #
628
+ # @example Basic example
629
+ # require "google/cloud/ai_platform/v1"
630
+ #
631
+ # # Create a client object. The client can be reused for multiple calls.
632
+ # client = Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.new
633
+ #
634
+ # # Create a request. To set request fields, pass in keyword arguments.
635
+ # request = Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest.new
636
+ #
637
+ # # Call the rebase_tuned_model method.
638
+ # result = client.rebase_tuned_model request
639
+ #
640
+ # # The returned object is of type Gapic::Operation. You can use it to
641
+ # # check the status of an operation, cancel it, or wait for results.
642
+ # # Here is how to wait for a response.
643
+ # result.wait_until_done! timeout: 60
644
+ # if result.response?
645
+ # p result.response
646
+ # else
647
+ # puts "No response received."
648
+ # end
649
+ #
650
+ def rebase_tuned_model request, options = nil
651
+ raise ::ArgumentError, "request must be provided" if request.nil?
652
+
653
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest
654
+
655
+ # Converts hash and nil to an options object
656
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
657
+
658
+ # Customize the options with defaults
659
+ metadata = @config.rpcs.rebase_tuned_model.metadata.to_h
660
+
661
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
662
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
663
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
664
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
665
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
666
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
667
+
668
+ header_params = {}
669
+ if request.parent
670
+ header_params["parent"] = request.parent
671
+ end
672
+
673
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
674
+ metadata[:"x-goog-request-params"] ||= request_params_header
675
+
676
+ options.apply_defaults timeout: @config.rpcs.rebase_tuned_model.timeout,
677
+ metadata: metadata,
678
+ retry_policy: @config.rpcs.rebase_tuned_model.retry_policy
679
+
680
+ options.apply_defaults timeout: @config.timeout,
681
+ metadata: @config.metadata,
682
+ retry_policy: @config.retry_policy
683
+
684
+ @gen_ai_tuning_service_stub.call_rpc :rebase_tuned_model, request, options: options do |response, operation|
685
+ response = ::Gapic::Operation.new response, @operations_client, options: options
686
+ yield response, operation if block_given?
687
+ return response
688
+ end
689
+ rescue ::GRPC::BadStatus => e
690
+ raise ::Google::Cloud::Error.from_error(e)
691
+ end
692
+
571
693
  ##
572
694
  # Configuration class for the GenAiTuningService API.
573
695
  #
@@ -741,6 +863,11 @@ module Google
741
863
  # @return [::Gapic::Config::Method]
742
864
  #
743
865
  attr_reader :cancel_tuning_job
866
+ ##
867
+ # RPC-specific configuration for `rebase_tuned_model`
868
+ # @return [::Gapic::Config::Method]
869
+ #
870
+ attr_reader :rebase_tuned_model
744
871
 
745
872
  # @private
746
873
  def initialize parent_rpcs = nil
@@ -752,6 +879,8 @@ module Google
752
879
  @list_tuning_jobs = ::Gapic::Config::Method.new list_tuning_jobs_config
753
880
  cancel_tuning_job_config = parent_rpcs.cancel_tuning_job if parent_rpcs.respond_to? :cancel_tuning_job
754
881
  @cancel_tuning_job = ::Gapic::Config::Method.new cancel_tuning_job_config
882
+ rebase_tuned_model_config = parent_rpcs.rebase_tuned_model if parent_rpcs.respond_to? :rebase_tuned_model
883
+ @rebase_tuned_model = ::Gapic::Config::Method.new rebase_tuned_model_config
755
884
 
756
885
  yield self if block_given?
757
886
  end