google-cloud-ai_platform-v1 0.52.0 → 0.54.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/client.rb +129 -0
  3. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/operations.rb +817 -0
  4. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/paths.rb +19 -0
  5. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/client.rb +122 -0
  6. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb +4181 -0
  7. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/service_stub.rb +60 -0
  8. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest.rb +1 -0
  9. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service.rb +1 -0
  10. data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
  11. data/lib/google/cloud/aiplatform/v1/content_pb.rb +5 -1
  12. data/lib/google/cloud/aiplatform/v1/feature_view_pb.rb +1 -1
  13. data/lib/google/cloud/aiplatform/v1/genai_tuning_service_pb.rb +8 -1
  14. data/lib/google/cloud/aiplatform/v1/genai_tuning_service_services_pb.rb +4 -0
  15. data/lib/google/cloud/aiplatform/v1/index_endpoint_pb.rb +1 -1
  16. data/lib/google/cloud/aiplatform/v1/openapi_pb.rb +1 -1
  17. data/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb +1 -1
  18. data/lib/google/cloud/aiplatform/v1/service_networking_pb.rb +2 -1
  19. data/lib/google/cloud/aiplatform/v1/tool_pb.rb +3 -1
  20. data/lib/google/cloud/aiplatform/v1/tuning_job_pb.rb +2 -1
  21. data/proto_docs/google/cloud/aiplatform/v1/content.rb +62 -0
  22. data/proto_docs/google/cloud/aiplatform/v1/feature_view.rb +4 -0
  23. data/proto_docs/google/cloud/aiplatform/v1/genai_tuning_service.rb +36 -0
  24. data/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb +5 -0
  25. data/proto_docs/google/cloud/aiplatform/v1/openapi.rb +4 -0
  26. data/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb +3 -0
  27. data/proto_docs/google/cloud/aiplatform/v1/service_networking.rb +18 -0
  28. data/proto_docs/google/cloud/aiplatform/v1/tool.rb +25 -0
  29. data/proto_docs/google/cloud/aiplatform/v1/tuning_job.rb +18 -1
  30. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed634c25b7d38f217e4203d6bd7822491e47c4a8283c5c6b6dce4edf4e4051a2
4
- data.tar.gz: 955200e93934c1b2b53a51f1e9a44fac10f5c95dd59ea5eddb26803c582f5ff1
3
+ metadata.gz: d3bca46c27ccf645c38e44ac1dea2e239c5e2fcaefb037f61d60e67bb88460a2
4
+ data.tar.gz: 41a4a70a863a13aafada12da8464de8c74138af989da0f699db021f58c109aa0
5
5
  SHA512:
6
- metadata.gz: 22309463ac8b9a3f7ccba19e138efc9a37c5ae2ae7b059817bbc9432fdeec79c3d9aa949db293d05fc42df460fa36a4a61b36b2d29a52d3b3b74fdcfecc24042
7
- data.tar.gz: 99b0898dd474cd953c9a9f20a899cbe5671b365f87aa69a36795c0fcc52836fa873f4215bb0a58020c45050d77a00990b5f9b823ae56c6c86a2b5a1fe42583b8
6
+ metadata.gz: 455a881ca39873c8ca119102af5baf3550664e21f8fd651823e0b608d3e294ee36e71df24ca08b1ad883987a05b29f0caaf5cf1a10494d130d270eeb16a4320f
7
+ data.tar.gz: dabe7bb54ad273c779fae6b145bd8ae59f95c0bc725698966084c8dd6c82143b962c396e2830961b70f4f9a7439a8ccfe61fc1fc942e327ab8ac077006768f75
@@ -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