google-cloud-ai_platform 2.0.1 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84c863c1ca70692e8ef84c6533ea9e2ae1a1a5bcf1020dec4f4c248c9339428c
4
- data.tar.gz: a4b8ca5fda0f64e4411b3f6009dcc75735b0c44c5a840d8147b5267dd985526b
3
+ metadata.gz: 51c2991cbfe306e790ab7ea37b0450df63e0e860e220827cfa75c1995a5f3ecf
4
+ data.tar.gz: 5d673865786c45b06a3b6fc25c01b6e77928e5051cda71daf68be5fa12473ca5
5
5
  SHA512:
6
- metadata.gz: 0727567ce179a72eafac5672d007bf1a7c9e2eb642ff2cc08013f307b45192c9d85470d5d45f352f74cf192e20bcd0ad83a4335a48d08b891a4e304eb9089cbf
7
- data.tar.gz: 39f5ad341394fc3e2048b4da3c785d6a673e73e2a625784741b70529b26c02b76cae39d302c6d199daf95244dc543084632e62873b32f6ee7522d8ca9cd0dec7
6
+ metadata.gz: '05311382ec068d851d372f76deeb4e62beaef9d3ebd9c827be0f286746020e85b06e965717e29110af55c22d739e434d81c615344e8ba49fa960ffa526134184'
7
+ data.tar.gz: 22e39d537ff8d08003b62b559f356a2fd8f2ce1f66f311542e6e975b3cd52cb5cea377be1ceb1c1f519519d7a8c3b42b4dfedad2ba0ce4337be3854143218987
data/AUTHENTICATION.md CHANGED
@@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization:
56
56
  ```ruby
57
57
  require "google/cloud/ai_platform"
58
58
 
59
- client = Google::Cloud::AIPlatform.dataset_service do |config|
59
+ client = Google::Cloud::AIPlatform.data_foundry_service do |config|
60
60
  config.credentials = "path/to/credentialfile.json"
61
61
  end
62
62
  ```
@@ -70,7 +70,7 @@ Google::Cloud::AIPlatform.configure do |config|
70
70
  config.credentials = "path/to/credentialfile.json"
71
71
  end
72
72
 
73
- client = Google::Cloud::AIPlatform.dataset_service
73
+ client = Google::Cloud::AIPlatform.data_foundry_service
74
74
  ```
75
75
 
76
76
  ### Environment Variables
@@ -100,7 +100,7 @@ require "google/cloud/ai_platform"
100
100
 
101
101
  ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
102
102
 
103
- client = Google::Cloud::AIPlatform.dataset_service
103
+ client = Google::Cloud::AIPlatform.data_foundry_service
104
104
  ```
105
105
 
106
106
  ### Local ADC file
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module AIPlatform
23
- VERSION = "2.0.1"
23
+ VERSION = "2.1.0"
24
24
  end
25
25
  end
26
26
  end
@@ -45,6 +45,76 @@ end
45
45
  module Google
46
46
  module Cloud
47
47
  module AIPlatform
48
+ ##
49
+ # Create a new client object for DataFoundryService.
50
+ #
51
+ # By default, this returns an instance of
52
+ # [Google::Cloud::AIPlatform::V1::DataFoundryService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-DataFoundryService-Client)
53
+ # for a gRPC client for version V1 of the API.
54
+ # However, you can specify a different API version by passing it in the
55
+ # `version` parameter. If the DataFoundryService service is
56
+ # supported by that API version, and the corresponding gem is available, the
57
+ # appropriate versioned client will be returned.
58
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
59
+ # the `transport` parameter.
60
+ #
61
+ # Raises an exception if the currently installed versioned client gem for the
62
+ # given API version does not support the given transport of the DataFoundryService service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::AIPlatform.data_foundry_service_available?}.
65
+ #
66
+ # ## About DataFoundryService
67
+ #
68
+ # Service for generating and preparing datasets for Gen AI evaluation.
69
+ #
70
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
71
+ # Defaults to `:v1`.
72
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
73
+ # @return [::Object] A client object for the specified version.
74
+ #
75
+ def self.data_foundry_service version: :v1, transport: :grpc, &block
76
+ require "google/cloud/ai_platform/#{version.to_s.downcase}"
77
+
78
+ package_name = Google::Cloud::AIPlatform
79
+ .constants
80
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
81
+ .first
82
+ service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:DataFoundryService)
83
+ service_module = service_module.const_get(:Rest) if transport == :rest
84
+ service_module.const_get(:Client).new(&block)
85
+ end
86
+
87
+ ##
88
+ # Determines whether the DataFoundryService service is supported by the current client.
89
+ # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.data_foundry_service}.
90
+ # If false, that method will raise an exception. This could happen if the given
91
+ # API version does not exist or does not support the DataFoundryService service,
92
+ # or if the versioned client gem needs an update to support the DataFoundryService service.
93
+ #
94
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
95
+ # Defaults to `:v1`.
96
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
97
+ # @return [boolean] Whether the service is available.
98
+ #
99
+ def self.data_foundry_service_available? version: :v1, transport: :grpc
100
+ require "google/cloud/ai_platform/#{version.to_s.downcase}"
101
+ package_name = Google::Cloud::AIPlatform
102
+ .constants
103
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
104
+ .first
105
+ return false unless package_name
106
+ service_module = Google::Cloud::AIPlatform.const_get package_name
107
+ return false unless service_module.const_defined? :DataFoundryService
108
+ service_module = service_module.const_get :DataFoundryService
109
+ if transport == :rest
110
+ return false unless service_module.const_defined? :Rest
111
+ service_module = service_module.const_get :Rest
112
+ end
113
+ service_module.const_defined? :Client
114
+ rescue ::LoadError
115
+ false
116
+ end
117
+
48
118
  ##
49
119
  # Create a new client object for DatasetService.
50
120
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-ai_platform
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  requirements: []
73
- rubygems_version: 3.6.8
73
+ rubygems_version: 3.6.9
74
74
  specification_version: 4
75
75
  summary: API Client library for the Vertex AI API
76
76
  test_files: []