ibm_watson 1.6.0 → 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 +4 -4
- data/README.md +42 -4
- data/lib/ibm_watson/assistant_v1.rb +277 -81
- data/lib/ibm_watson/assistant_v2.rb +100 -22
- data/lib/ibm_watson/compare_comply_v1.rb +44 -23
- data/lib/ibm_watson/discovery_v1.rb +132 -14
- data/lib/ibm_watson/discovery_v2.rb +234 -18
- data/lib/ibm_watson/language_translator_v3.rb +59 -27
- data/lib/ibm_watson/natural_language_classifier_v1.rb +3 -2
- data/lib/ibm_watson/natural_language_understanding_v1.rb +705 -14
- data/lib/ibm_watson/personality_insights_v3.rb +29 -18
- data/lib/ibm_watson/speech_to_text_v1.rb +278 -121
- data/lib/ibm_watson/text_to_speech_v1.rb +689 -130
- data/lib/ibm_watson/tone_analyzer_v3.rb +11 -13
- data/lib/ibm_watson/version.rb +1 -1
- data/lib/ibm_watson/visual_recognition_v3.rb +32 -16
- data/lib/ibm_watson/visual_recognition_v4.rb +67 -23
- data/test/integration/test_assistant_v1.rb +9 -0
- data/test/integration/test_assistant_v2.rb +9 -0
- data/test/integration/test_discovery_v2.rb +29 -0
- data/test/integration/test_natural_language_understanding_v1.rb +134 -1
- data/test/integration/test_text_to_speech_v1.rb +60 -3
- data/test/unit/test_assistant_v1.rb +52 -1
- data/test/unit/test_assistant_v2.rb +51 -0
- data/test/unit/test_discovery_v2.rb +30 -1
- data/test/unit/test_natural_language_understanding_v1.rb +231 -0
- data/test/unit/test_text_to_speech_v1.rb +152 -7
- metadata +12 -11
@@ -13,7 +13,9 @@
|
|
13
13
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
|
-
|
16
|
+
#
|
17
|
+
# IBM OpenAPI SDK Code Generator Version: 3.31.0-902c9336-20210504-161156
|
18
|
+
#
|
17
19
|
# The IBM Watson™ Tone Analyzer service uses linguistic analysis to detect
|
18
20
|
# emotional and language tones in written text. The service can analyze tone at both the
|
19
21
|
# document and sentence levels. You can use the service to understand how your written
|
@@ -32,7 +34,6 @@ require "json"
|
|
32
34
|
require "ibm_cloud_sdk_core"
|
33
35
|
require_relative "./common.rb"
|
34
36
|
|
35
|
-
# Module for the Watson APIs
|
36
37
|
module IBMWatson
|
37
38
|
##
|
38
39
|
# The Tone Analyzer V3 service.
|
@@ -40,21 +41,14 @@ module IBMWatson
|
|
40
41
|
include Concurrent::Async
|
41
42
|
DEFAULT_SERVICE_NAME = "tone_analyzer"
|
42
43
|
DEFAULT_SERVICE_URL = "https://api.us-south.tone-analyzer.watson.cloud.ibm.com"
|
44
|
+
attr_accessor :version
|
43
45
|
##
|
44
46
|
# @!method initialize(args)
|
45
47
|
# Construct a new client for the Tone Analyzer service.
|
46
48
|
#
|
47
49
|
# @param args [Hash] The args to initialize with
|
48
|
-
# @option args version [String]
|
49
|
-
#
|
50
|
-
# incompatible way, a new minor version of the API is released.
|
51
|
-
# The service uses the API version for the date you specify, or
|
52
|
-
# the most recent version before that date. Note that you should
|
53
|
-
# not programmatically specify the current date at runtime, in
|
54
|
-
# case the API has been updated since your application's release.
|
55
|
-
# Instead, specify a version date that is compatible with your
|
56
|
-
# application, and don't change it until your application is
|
57
|
-
# ready for a later version.
|
50
|
+
# @option args version [String] Release date of the version of the API you want to use. Specify dates in
|
51
|
+
# YYYY-MM-DD format. The current version is `2017-09-21`.
|
58
52
|
# @option args service_url [String] The base service URL to use when contacting the service.
|
59
53
|
# The base service_url may differ between IBM Cloud regions.
|
60
54
|
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
|
@@ -63,10 +57,10 @@ module IBMWatson
|
|
63
57
|
def initialize(args = {})
|
64
58
|
@__async_initialized__ = false
|
65
59
|
defaults = {}
|
66
|
-
defaults[:version] = nil
|
67
60
|
defaults[:service_url] = DEFAULT_SERVICE_URL
|
68
61
|
defaults[:service_name] = DEFAULT_SERVICE_NAME
|
69
62
|
defaults[:authenticator] = nil
|
63
|
+
defaults[:version] = nil
|
70
64
|
user_service_url = args[:service_url] unless args[:service_url].nil?
|
71
65
|
args = defaults.merge(args)
|
72
66
|
@version = args[:version]
|
@@ -131,6 +125,8 @@ module IBMWatson
|
|
131
125
|
# **Accept-Language**.
|
132
126
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
133
127
|
def tone(tone_input:, content_type: nil, sentences: nil, tones: nil, content_language: nil, accept_language: nil)
|
128
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
129
|
+
|
134
130
|
raise ArgumentError.new("tone_input must be provided") if tone_input.nil?
|
135
131
|
|
136
132
|
headers = {
|
@@ -199,6 +195,8 @@ module IBMWatson
|
|
199
195
|
# **Accept-Language**.
|
200
196
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
201
197
|
def tone_chat(utterances:, content_language: nil, accept_language: nil)
|
198
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
199
|
+
|
202
200
|
raise ArgumentError.new("utterances must be provided") if utterances.nil?
|
203
201
|
|
204
202
|
headers = {
|
data/lib/ibm_watson/version.rb
CHANGED
@@ -13,10 +13,17 @@
|
|
13
13
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
|
-
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
16
|
+
#
|
17
|
+
# IBM OpenAPI SDK Code Generator Version: 3.31.0-902c9336-20210504-161156
|
18
|
+
#
|
19
|
+
# IBM Watson™ Visual Recognition is discontinued. Existing instances are supported
|
20
|
+
# until 1 December 2021, but as of 7 January 2021, you can't create instances. Any
|
21
|
+
# instance that is provisioned on 1 December 2021 will be deleted.
|
22
|
+
# {: deprecated}
|
23
|
+
#
|
24
|
+
# The IBM Watson Visual Recognition service uses deep learning algorithms to identify
|
25
|
+
# scenes and objects in images that you upload to the service. You can create and train a
|
26
|
+
# custom classifier to identify subjects that suit your needs.
|
20
27
|
|
21
28
|
require "concurrent"
|
22
29
|
require "erb"
|
@@ -24,7 +31,6 @@ require "json"
|
|
24
31
|
require "ibm_cloud_sdk_core"
|
25
32
|
require_relative "./common.rb"
|
26
33
|
|
27
|
-
# Module for the Watson APIs
|
28
34
|
module IBMWatson
|
29
35
|
##
|
30
36
|
# The Visual Recognition V3 service.
|
@@ -32,33 +38,27 @@ module IBMWatson
|
|
32
38
|
include Concurrent::Async
|
33
39
|
DEFAULT_SERVICE_NAME = "visual_recognition"
|
34
40
|
DEFAULT_SERVICE_URL = "https://api.us-south.visual-recognition.watson.cloud.ibm.com"
|
41
|
+
attr_accessor :version
|
35
42
|
##
|
36
43
|
# @!method initialize(args)
|
37
44
|
# Construct a new client for the Visual Recognition service.
|
38
45
|
#
|
39
46
|
# @param args [Hash] The args to initialize with
|
40
|
-
# @option args version [String]
|
41
|
-
#
|
42
|
-
# incompatible way, a new minor version of the API is released.
|
43
|
-
# The service uses the API version for the date you specify, or
|
44
|
-
# the most recent version before that date. Note that you should
|
45
|
-
# not programmatically specify the current date at runtime, in
|
46
|
-
# case the API has been updated since your application's release.
|
47
|
-
# Instead, specify a version date that is compatible with your
|
48
|
-
# application, and don't change it until your application is
|
49
|
-
# ready for a later version.
|
47
|
+
# @option args version [String] Release date of the API version you want to use. Specify dates in YYYY-MM-DD
|
48
|
+
# format. The current version is `2018-03-19`.
|
50
49
|
# @option args service_url [String] The base service URL to use when contacting the service.
|
51
50
|
# The base service_url may differ between IBM Cloud regions.
|
52
51
|
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
|
53
52
|
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
|
54
53
|
# any external configuration, if applicable.
|
55
54
|
def initialize(args = {})
|
55
|
+
warn "On 1 December 2021, Visual Recognition will no longer be available. For more information, see https://github.com/watson-developer-cloud/ruby-sdk/tree/master#visual-recognition-deprecation."
|
56
56
|
@__async_initialized__ = false
|
57
57
|
defaults = {}
|
58
|
-
defaults[:version] = nil
|
59
58
|
defaults[:service_url] = DEFAULT_SERVICE_URL
|
60
59
|
defaults[:service_name] = DEFAULT_SERVICE_NAME
|
61
60
|
defaults[:authenticator] = nil
|
61
|
+
defaults[:version] = nil
|
62
62
|
user_service_url = args[:service_url] unless args[:service_url].nil?
|
63
63
|
args = defaults.merge(args)
|
64
64
|
@version = args[:version]
|
@@ -112,6 +112,8 @@ module IBMWatson
|
|
112
112
|
# @param accept_language [String] The desired language of parts of the response. See the response for details.
|
113
113
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
114
114
|
def classify(images_file: nil, images_filename: nil, images_file_content_type: nil, url: nil, threshold: nil, owners: nil, classifier_ids: nil, accept_language: nil)
|
115
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
116
|
+
|
115
117
|
headers = {
|
116
118
|
"Accept-Language" => accept_language
|
117
119
|
}
|
@@ -198,6 +200,8 @@ module IBMWatson
|
|
198
200
|
# @param negative_examples_filename [String] The filename for negative_examples.
|
199
201
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
200
202
|
def create_classifier(name:, positive_examples:, negative_examples: nil, negative_examples_filename: nil)
|
203
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
204
|
+
|
201
205
|
raise ArgumentError.new("name must be provided") if name.nil?
|
202
206
|
|
203
207
|
raise ArgumentError.new("positive_examples must be a hash") unless positive_examples.is_a?(Hash)
|
@@ -253,6 +257,8 @@ module IBMWatson
|
|
253
257
|
# return a brief list of classifiers.
|
254
258
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
255
259
|
def list_classifiers(verbose: nil)
|
260
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
261
|
+
|
256
262
|
headers = {
|
257
263
|
}
|
258
264
|
sdk_headers = Common.new.get_sdk_headers("watson_vision_combined", "V3", "list_classifiers")
|
@@ -282,6 +288,8 @@ module IBMWatson
|
|
282
288
|
# @param classifier_id [String] The ID of the classifier.
|
283
289
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
284
290
|
def get_classifier(classifier_id:)
|
291
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
292
|
+
|
285
293
|
raise ArgumentError.new("classifier_id must be provided") if classifier_id.nil?
|
286
294
|
|
287
295
|
headers = {
|
@@ -350,6 +358,8 @@ module IBMWatson
|
|
350
358
|
# @param negative_examples_filename [String] The filename for negative_examples.
|
351
359
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
352
360
|
def update_classifier(classifier_id:, positive_examples: nil, negative_examples: nil, negative_examples_filename: nil)
|
361
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
362
|
+
|
353
363
|
raise ArgumentError.new("classifier_id must be provided") if classifier_id.nil?
|
354
364
|
|
355
365
|
raise ArgumentError.new("positive_examples must be a hash") unless positive_examples.nil? || positive_examples.is_a?(Hash)
|
@@ -401,6 +411,8 @@ module IBMWatson
|
|
401
411
|
# @param classifier_id [String] The ID of the classifier.
|
402
412
|
# @return [nil]
|
403
413
|
def delete_classifier(classifier_id:)
|
414
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
415
|
+
|
404
416
|
raise ArgumentError.new("classifier_id must be provided") if classifier_id.nil?
|
405
417
|
|
406
418
|
headers = {
|
@@ -435,6 +447,8 @@ module IBMWatson
|
|
435
447
|
# @param classifier_id [String] The ID of the classifier.
|
436
448
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
437
449
|
def get_core_ml_model(classifier_id:)
|
450
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
451
|
+
|
438
452
|
raise ArgumentError.new("classifier_id must be provided") if classifier_id.nil?
|
439
453
|
|
440
454
|
headers = {
|
@@ -474,6 +488,8 @@ module IBMWatson
|
|
474
488
|
# @param customer_id [String] The customer ID for which all data is to be deleted.
|
475
489
|
# @return [nil]
|
476
490
|
def delete_user_data(customer_id:)
|
491
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
492
|
+
|
477
493
|
raise ArgumentError.new("customer_id must be provided") if customer_id.nil?
|
478
494
|
|
479
495
|
headers = {
|
@@ -13,9 +13,16 @@
|
|
13
13
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
|
-
|
17
|
-
#
|
18
|
-
#
|
16
|
+
#
|
17
|
+
# IBM OpenAPI SDK Code Generator Version: 3.31.0-902c9336-20210504-161156
|
18
|
+
#
|
19
|
+
# IBM Watson™ Visual Recognition is discontinued. Existing instances are supported
|
20
|
+
# until 1 December 2021, but as of 7 January 2021, you can't create instances. Any
|
21
|
+
# instance that is provisioned on 1 December 2021 will be deleted.
|
22
|
+
# {: deprecated}
|
23
|
+
#
|
24
|
+
# Provide images to the IBM Watson Visual Recognition service for analysis. The service
|
25
|
+
# detects objects based on a set of images with training data.
|
19
26
|
|
20
27
|
require "concurrent"
|
21
28
|
require "erb"
|
@@ -23,7 +30,6 @@ require "json"
|
|
23
30
|
require "ibm_cloud_sdk_core"
|
24
31
|
require_relative "./common.rb"
|
25
32
|
|
26
|
-
# Module for the Watson APIs
|
27
33
|
module IBMWatson
|
28
34
|
##
|
29
35
|
# The Visual Recognition V4 service.
|
@@ -31,33 +37,27 @@ module IBMWatson
|
|
31
37
|
include Concurrent::Async
|
32
38
|
DEFAULT_SERVICE_NAME = "visual_recognition"
|
33
39
|
DEFAULT_SERVICE_URL = "https://api.us-south.visual-recognition.watson.cloud.ibm.com"
|
40
|
+
attr_accessor :version
|
34
41
|
##
|
35
42
|
# @!method initialize(args)
|
36
43
|
# Construct a new client for the Visual Recognition service.
|
37
44
|
#
|
38
45
|
# @param args [Hash] The args to initialize with
|
39
|
-
# @option args version [String]
|
40
|
-
#
|
41
|
-
# incompatible way, a new minor version of the API is released.
|
42
|
-
# The service uses the API version for the date you specify, or
|
43
|
-
# the most recent version before that date. Note that you should
|
44
|
-
# not programmatically specify the current date at runtime, in
|
45
|
-
# case the API has been updated since your application's release.
|
46
|
-
# Instead, specify a version date that is compatible with your
|
47
|
-
# application, and don't change it until your application is
|
48
|
-
# ready for a later version.
|
46
|
+
# @option args version [String] Release date of the API version you want to use. Specify dates in YYYY-MM-DD
|
47
|
+
# format. The current version is `2019-02-11`.
|
49
48
|
# @option args service_url [String] The base service URL to use when contacting the service.
|
50
49
|
# The base service_url may differ between IBM Cloud regions.
|
51
50
|
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
|
52
51
|
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
|
53
52
|
# any external configuration, if applicable.
|
54
53
|
def initialize(args = {})
|
54
|
+
warn "On 1 December 2021, Visual Recognition will no longer be available. For more information, see https://github.com/watson-developer-cloud/ruby-sdk/tree/master#visual-recognition-deprecation."
|
55
55
|
@__async_initialized__ = false
|
56
56
|
defaults = {}
|
57
|
-
defaults[:version] = nil
|
58
57
|
defaults[:service_url] = DEFAULT_SERVICE_URL
|
59
58
|
defaults[:service_name] = DEFAULT_SERVICE_NAME
|
60
59
|
defaults[:authenticator] = nil
|
60
|
+
defaults[:version] = nil
|
61
61
|
user_service_url = args[:service_url] unless args[:service_url].nil?
|
62
62
|
args = defaults.merge(args)
|
63
63
|
@version = args[:version]
|
@@ -101,6 +101,8 @@ module IBMWatson
|
|
101
101
|
# @param threshold [Float] The minimum score a feature must have to be returned.
|
102
102
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
103
103
|
def analyze(collection_ids:, features:, images_file: nil, image_url: nil, threshold: nil)
|
104
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
105
|
+
|
104
106
|
raise ArgumentError.new("collection_ids must be provided") if collection_ids.nil?
|
105
107
|
|
106
108
|
raise ArgumentError.new("features must be provided") if features.nil?
|
@@ -156,7 +158,7 @@ module IBMWatson
|
|
156
158
|
#########################
|
157
159
|
|
158
160
|
##
|
159
|
-
# @!method create_collection(name: nil, description: nil)
|
161
|
+
# @!method create_collection(name: nil, description: nil, training_status: nil)
|
160
162
|
# Create a collection.
|
161
163
|
# Create a collection that can be used to store images.
|
162
164
|
#
|
@@ -168,8 +170,11 @@ module IBMWatson
|
|
168
170
|
# @param name [String] The name of the collection. The name can contain alphanumeric, underscore, hyphen,
|
169
171
|
# and dot characters. It cannot begin with the reserved prefix `sys-`.
|
170
172
|
# @param description [String] The description of the collection.
|
173
|
+
# @param training_status [TrainingStatus] Training status information for the collection.
|
171
174
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
172
|
-
def create_collection(name: nil, description: nil)
|
175
|
+
def create_collection(name: nil, description: nil, training_status: nil)
|
176
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
177
|
+
|
173
178
|
headers = {
|
174
179
|
}
|
175
180
|
sdk_headers = Common.new.get_sdk_headers("watson_vision_combined", "V4", "create_collection")
|
@@ -181,7 +186,8 @@ module IBMWatson
|
|
181
186
|
|
182
187
|
data = {
|
183
188
|
"name" => name,
|
184
|
-
"description" => description
|
189
|
+
"description" => description,
|
190
|
+
"training_status" => training_status
|
185
191
|
}
|
186
192
|
|
187
193
|
method_url = "/v4/collections"
|
@@ -203,6 +209,8 @@ module IBMWatson
|
|
203
209
|
# Retrieves a list of collections for the service instance.
|
204
210
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
205
211
|
def list_collections
|
212
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
213
|
+
|
206
214
|
headers = {
|
207
215
|
}
|
208
216
|
sdk_headers = Common.new.get_sdk_headers("watson_vision_combined", "V4", "list_collections")
|
@@ -231,6 +239,8 @@ module IBMWatson
|
|
231
239
|
# @param collection_id [String] The identifier of the collection.
|
232
240
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
233
241
|
def get_collection(collection_id:)
|
242
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
243
|
+
|
234
244
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
235
245
|
|
236
246
|
headers = {
|
@@ -255,7 +265,7 @@ module IBMWatson
|
|
255
265
|
end
|
256
266
|
|
257
267
|
##
|
258
|
-
# @!method update_collection(collection_id:, name: nil, description: nil)
|
268
|
+
# @!method update_collection(collection_id:, name: nil, description: nil, training_status: nil)
|
259
269
|
# Update a collection.
|
260
270
|
# Update the name or description of a collection.
|
261
271
|
#
|
@@ -265,8 +275,11 @@ module IBMWatson
|
|
265
275
|
# @param name [String] The name of the collection. The name can contain alphanumeric, underscore, hyphen,
|
266
276
|
# and dot characters. It cannot begin with the reserved prefix `sys-`.
|
267
277
|
# @param description [String] The description of the collection.
|
278
|
+
# @param training_status [TrainingStatus] Training status information for the collection.
|
268
279
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
269
|
-
def update_collection(collection_id:, name: nil, description: nil)
|
280
|
+
def update_collection(collection_id:, name: nil, description: nil, training_status: nil)
|
281
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
282
|
+
|
270
283
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
271
284
|
|
272
285
|
headers = {
|
@@ -280,7 +293,8 @@ module IBMWatson
|
|
280
293
|
|
281
294
|
data = {
|
282
295
|
"name" => name,
|
283
|
-
"description" => description
|
296
|
+
"description" => description,
|
297
|
+
"training_status" => training_status
|
284
298
|
}
|
285
299
|
|
286
300
|
method_url = "/v4/collections/%s" % [ERB::Util.url_encode(collection_id)]
|
@@ -303,6 +317,8 @@ module IBMWatson
|
|
303
317
|
# @param collection_id [String] The identifier of the collection.
|
304
318
|
# @return [nil]
|
305
319
|
def delete_collection(collection_id:)
|
320
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
321
|
+
|
306
322
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
307
323
|
|
308
324
|
headers = {
|
@@ -342,6 +358,8 @@ module IBMWatson
|
|
342
358
|
# @param model_format [String] The format of the returned model.
|
343
359
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
344
360
|
def get_model_file(collection_id:, feature:, model_format:)
|
361
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
362
|
+
|
345
363
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
346
364
|
|
347
365
|
raise ArgumentError.new("feature must be provided") if feature.nil?
|
@@ -405,6 +423,8 @@ module IBMWatson
|
|
405
423
|
# than 32 characters.
|
406
424
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
407
425
|
def add_images(collection_id:, images_file: nil, image_url: nil, training_data: nil)
|
426
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
427
|
+
|
408
428
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
409
429
|
|
410
430
|
headers = {
|
@@ -454,6 +474,8 @@ module IBMWatson
|
|
454
474
|
# @param collection_id [String] The identifier of the collection.
|
455
475
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
456
476
|
def list_images(collection_id:)
|
477
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
478
|
+
|
457
479
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
458
480
|
|
459
481
|
headers = {
|
@@ -485,6 +507,8 @@ module IBMWatson
|
|
485
507
|
# @param image_id [String] The identifier of the image.
|
486
508
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
487
509
|
def get_image_details(collection_id:, image_id:)
|
510
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
511
|
+
|
488
512
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
489
513
|
|
490
514
|
raise ArgumentError.new("image_id must be provided") if image_id.nil?
|
@@ -518,6 +542,8 @@ module IBMWatson
|
|
518
542
|
# @param image_id [String] The identifier of the image.
|
519
543
|
# @return [nil]
|
520
544
|
def delete_image(collection_id:, image_id:)
|
545
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
546
|
+
|
521
547
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
522
548
|
|
523
549
|
raise ArgumentError.new("image_id must be provided") if image_id.nil?
|
@@ -554,6 +580,8 @@ module IBMWatson
|
|
554
580
|
# For example, an original 800 x 1000 image is resized to 160 x 200 pixels.
|
555
581
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
556
582
|
def get_jpeg_image(collection_id:, image_id:, size: nil)
|
583
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
584
|
+
|
557
585
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
558
586
|
|
559
587
|
raise ArgumentError.new("image_id must be provided") if image_id.nil?
|
@@ -590,6 +618,8 @@ module IBMWatson
|
|
590
618
|
# @param collection_id [String] The identifier of the collection.
|
591
619
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
592
620
|
def list_object_metadata(collection_id:)
|
621
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
622
|
+
|
593
623
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
594
624
|
|
595
625
|
headers = {
|
@@ -625,6 +655,8 @@ module IBMWatson
|
|
625
655
|
# `sys-`.
|
626
656
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
627
657
|
def update_object_metadata(collection_id:, object:, new_object:)
|
658
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
659
|
+
|
628
660
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
629
661
|
|
630
662
|
raise ArgumentError.new("object must be provided") if object.nil?
|
@@ -665,6 +697,8 @@ module IBMWatson
|
|
665
697
|
# @param object [String] The name of the object.
|
666
698
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
667
699
|
def get_object_metadata(collection_id:, object:)
|
700
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
701
|
+
|
668
702
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
669
703
|
|
670
704
|
raise ArgumentError.new("object must be provided") if object.nil?
|
@@ -699,6 +733,8 @@ module IBMWatson
|
|
699
733
|
# @param object [String] The name of the object.
|
700
734
|
# @return [nil]
|
701
735
|
def delete_object(collection_id:, object:)
|
736
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
737
|
+
|
702
738
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
703
739
|
|
704
740
|
raise ArgumentError.new("object must be provided") if object.nil?
|
@@ -736,6 +772,8 @@ module IBMWatson
|
|
736
772
|
# @param collection_id [String] The identifier of the collection.
|
737
773
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
738
774
|
def train(collection_id:)
|
775
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
776
|
+
|
739
777
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
740
778
|
|
741
779
|
headers = {
|
@@ -777,6 +815,8 @@ module IBMWatson
|
|
777
815
|
# @param objects [Array[TrainingDataObject]] Training data for specific objects.
|
778
816
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
779
817
|
def add_image_training_data(collection_id:, image_id:, objects: nil)
|
818
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
819
|
+
|
780
820
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
781
821
|
|
782
822
|
raise ArgumentError.new("image_id must be provided") if image_id.nil?
|
@@ -812,14 +852,16 @@ module IBMWatson
|
|
812
852
|
# Get training usage.
|
813
853
|
# Information about the completed training events. You can use this information to
|
814
854
|
# determine how close you are to the training limits for the month.
|
815
|
-
# @param start_time [
|
855
|
+
# @param start_time [Time] The earliest day to include training events. Specify dates in YYYY-MM-DD format.
|
816
856
|
# If empty or not specified, the earliest training event is included.
|
817
|
-
# @param end_time [
|
857
|
+
# @param end_time [Time] The most recent day to include training events. Specify dates in YYYY-MM-DD
|
818
858
|
# format. All events for the day are included. If empty or not specified, the
|
819
859
|
# current day is used. Specify the same value as `start_time` to request events for
|
820
860
|
# a single day.
|
821
861
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
822
862
|
def get_training_usage(start_time: nil, end_time: nil)
|
863
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
864
|
+
|
823
865
|
headers = {
|
824
866
|
}
|
825
867
|
sdk_headers = Common.new.get_sdk_headers("watson_vision_combined", "V4", "get_training_usage")
|
@@ -859,6 +901,8 @@ module IBMWatson
|
|
859
901
|
# @param customer_id [String] The customer ID for which all data is to be deleted.
|
860
902
|
# @return [nil]
|
861
903
|
def delete_user_data(customer_id:)
|
904
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
905
|
+
|
862
906
|
raise ArgumentError.new("customer_id must be provided") if customer_id.nil?
|
863
907
|
|
864
908
|
headers = {
|