google-cloud-ai_platform-v1 0.51.0 → 0.53.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.
Files changed (26) 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/llm_utility_service/client.rb +4 -1
  11. data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/client.rb +4 -1
  12. data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +18 -2
  13. data/lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb +18 -2
  14. data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
  15. data/lib/google/cloud/aiplatform/v1/content_pb.rb +4 -1
  16. data/lib/google/cloud/aiplatform/v1/genai_tuning_service_pb.rb +8 -1
  17. data/lib/google/cloud/aiplatform/v1/genai_tuning_service_services_pb.rb +4 -0
  18. data/lib/google/cloud/aiplatform/v1/openapi_pb.rb +1 -1
  19. data/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb +1 -1
  20. data/lib/google/cloud/aiplatform/v1/tuning_job_pb.rb +2 -1
  21. data/proto_docs/google/cloud/aiplatform/v1/content.rb +49 -0
  22. data/proto_docs/google/cloud/aiplatform/v1/genai_tuning_service.rb +36 -0
  23. data/proto_docs/google/cloud/aiplatform/v1/openapi.rb +11 -2
  24. data/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb +26 -0
  25. data/proto_docs/google/cloud/aiplatform/v1/tuning_job.rb +18 -1
  26. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58b6a9a46c5412112362c86c174fe8c32a26e3807345e4924f7dfb2713b208e1
4
- data.tar.gz: b167428e4cc6f5d05cb729c8c547af53b9889c995233691243a069cb63c42cc4
3
+ metadata.gz: d09d9bb75fb78c88c5c5c3574e6d1e680af66aa7b0446c285b809b6b839f9851
4
+ data.tar.gz: 10310f10cff95a6d5a74d097d737daa2697d029c017f3c5bd5b7301a4cfb021c
5
5
  SHA512:
6
- metadata.gz: 14a6bdbda613e5bc48f0fc12911cf3e09b7496d426cb75c765d2f49e9de56291060cc5e782515897769d9820d7e981ca4ae9321f6235b0d9ec4c8429732376c1
7
- data.tar.gz: ea33e0331feb22983bf6734baa61c39b93689bbf0603205349547759794061abd204f8fbac9a6520ebcb2f23baf21a60a68d384e466f79672098aee64f7d5156
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