ibm_watson 1.4.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +43 -6
- data/lib/ibm_watson/assistant_v1.rb +213 -195
- data/lib/ibm_watson/assistant_v2.rb +221 -20
- data/lib/ibm_watson/compare_comply_v1.rb +35 -21
- data/lib/ibm_watson/discovery_v1.rb +132 -13
- data/lib/ibm_watson/discovery_v2.rb +734 -21
- data/lib/ibm_watson/language_translator_v3.rb +205 -67
- data/lib/ibm_watson/natural_language_classifier_v1.rb +4 -2
- data/lib/ibm_watson/natural_language_understanding_v1.rb +21 -21
- data/lib/ibm_watson/personality_insights_v3.rb +27 -18
- data/lib/ibm_watson/speech_to_text_v1.rb +65 -53
- data/lib/ibm_watson/text_to_speech_v1.rb +124 -140
- data/lib/ibm_watson/tone_analyzer_v3.rb +12 -13
- data/lib/ibm_watson/version.rb +1 -1
- data/lib/ibm_watson/visual_recognition_v3.rb +33 -16
- data/lib/ibm_watson/visual_recognition_v4.rb +103 -17
- data/test/integration/test_assistant_v1.rb +9 -0
- data/test/integration/test_assistant_v2.rb +34 -0
- data/test/integration/test_discovery_v2.rb +132 -6
- data/test/integration/test_language_translator_v3.rb +5 -0
- data/test/integration/test_text_to_speech_v1.rb +3 -3
- data/test/integration/test_visual_recognition_v4.rb +9 -0
- data/test/unit/test_assistant_v1.rb +150 -99
- data/test/unit/test_assistant_v2.rb +153 -8
- data/test/unit/test_compare_comply_v1.rb +20 -20
- data/test/unit/test_discovery_v1.rb +125 -125
- data/test/unit/test_discovery_v2.rb +262 -29
- data/test/unit/test_language_translator_v3.rb +85 -24
- data/test/unit/test_natural_language_classifier_v1.rb +17 -17
- data/test/unit/test_natural_language_understanding_v1.rb +10 -10
- data/test/unit/test_personality_insights_v3.rb +14 -14
- data/test/unit/test_speech_to_text_v1.rb +97 -97
- data/test/unit/test_text_to_speech_v1.rb +48 -48
- data/test/unit/test_tone_analyzer_v3.rb +12 -12
- data/test/unit/test_visual_recognition_v3.rb +16 -16
- data/test/unit/test_visual_recognition_v4.rb +56 -38
- metadata +8 -7
@@ -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.19.0-be3b4618-20201113-200858
|
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
|
@@ -39,22 +41,15 @@ module IBMWatson
|
|
39
41
|
class ToneAnalyzerV3 < IBMCloudSdkCore::BaseService
|
40
42
|
include Concurrent::Async
|
41
43
|
DEFAULT_SERVICE_NAME = "tone_analyzer"
|
42
|
-
DEFAULT_SERVICE_URL = "https://
|
44
|
+
DEFAULT_SERVICE_URL = "https://api.us-south.tone-analyzer.watson.cloud.ibm.com"
|
45
|
+
attr_accessor :version
|
43
46
|
##
|
44
47
|
# @!method initialize(args)
|
45
48
|
# Construct a new client for the Tone Analyzer service.
|
46
49
|
#
|
47
50
|
# @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.
|
51
|
+
# @option args version [String] Release date of the version of the API you want to use. Specify dates in
|
52
|
+
# YYYY-MM-DD format. The current version is `2017-09-21`.
|
58
53
|
# @option args service_url [String] The base service URL to use when contacting the service.
|
59
54
|
# The base service_url may differ between IBM Cloud regions.
|
60
55
|
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
|
@@ -63,10 +58,10 @@ module IBMWatson
|
|
63
58
|
def initialize(args = {})
|
64
59
|
@__async_initialized__ = false
|
65
60
|
defaults = {}
|
66
|
-
defaults[:version] = nil
|
67
61
|
defaults[:service_url] = DEFAULT_SERVICE_URL
|
68
62
|
defaults[:service_name] = DEFAULT_SERVICE_NAME
|
69
63
|
defaults[:authenticator] = nil
|
64
|
+
defaults[:version] = nil
|
70
65
|
user_service_url = args[:service_url] unless args[:service_url].nil?
|
71
66
|
args = defaults.merge(args)
|
72
67
|
@version = args[:version]
|
@@ -131,6 +126,8 @@ module IBMWatson
|
|
131
126
|
# **Accept-Language**.
|
132
127
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
133
128
|
def tone(tone_input:, content_type: nil, sentences: nil, tones: nil, content_language: nil, accept_language: nil)
|
129
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
130
|
+
|
134
131
|
raise ArgumentError.new("tone_input must be provided") if tone_input.nil?
|
135
132
|
|
136
133
|
headers = {
|
@@ -199,6 +196,8 @@ module IBMWatson
|
|
199
196
|
# **Accept-Language**.
|
200
197
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
201
198
|
def tone_chat(utterances:, content_language: nil, accept_language: nil)
|
199
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
200
|
+
|
202
201
|
raise ArgumentError.new("utterances must be provided") if utterances.nil?
|
203
202
|
|
204
203
|
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.19.0-be3b4618-20201113-200858
|
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"
|
@@ -31,34 +38,28 @@ module IBMWatson
|
|
31
38
|
class VisualRecognitionV3 < IBMCloudSdkCore::BaseService
|
32
39
|
include Concurrent::Async
|
33
40
|
DEFAULT_SERVICE_NAME = "visual_recognition"
|
34
|
-
DEFAULT_SERVICE_URL = "https://
|
41
|
+
DEFAULT_SERVICE_URL = "https://api.us-south.visual-recognition.watson.cloud.ibm.com"
|
42
|
+
attr_accessor :version
|
35
43
|
##
|
36
44
|
# @!method initialize(args)
|
37
45
|
# Construct a new client for the Visual Recognition service.
|
38
46
|
#
|
39
47
|
# @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.
|
48
|
+
# @option args version [String] Release date of the API version you want to use. Specify dates in YYYY-MM-DD
|
49
|
+
# format. The current version is `2018-03-19`.
|
50
50
|
# @option args service_url [String] The base service URL to use when contacting the service.
|
51
51
|
# The base service_url may differ between IBM Cloud regions.
|
52
52
|
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
|
53
53
|
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
|
54
54
|
# any external configuration, if applicable.
|
55
55
|
def initialize(args = {})
|
56
|
+
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
57
|
@__async_initialized__ = false
|
57
58
|
defaults = {}
|
58
|
-
defaults[:version] = nil
|
59
59
|
defaults[:service_url] = DEFAULT_SERVICE_URL
|
60
60
|
defaults[:service_name] = DEFAULT_SERVICE_NAME
|
61
61
|
defaults[:authenticator] = nil
|
62
|
+
defaults[:version] = nil
|
62
63
|
user_service_url = args[:service_url] unless args[:service_url].nil?
|
63
64
|
args = defaults.merge(args)
|
64
65
|
@version = args[:version]
|
@@ -112,6 +113,8 @@ module IBMWatson
|
|
112
113
|
# @param accept_language [String] The desired language of parts of the response. See the response for details.
|
113
114
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
114
115
|
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)
|
116
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
117
|
+
|
115
118
|
headers = {
|
116
119
|
"Accept-Language" => accept_language
|
117
120
|
}
|
@@ -198,6 +201,8 @@ module IBMWatson
|
|
198
201
|
# @param negative_examples_filename [String] The filename for negative_examples.
|
199
202
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
200
203
|
def create_classifier(name:, positive_examples:, negative_examples: nil, negative_examples_filename: nil)
|
204
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
205
|
+
|
201
206
|
raise ArgumentError.new("name must be provided") if name.nil?
|
202
207
|
|
203
208
|
raise ArgumentError.new("positive_examples must be a hash") unless positive_examples.is_a?(Hash)
|
@@ -253,6 +258,8 @@ module IBMWatson
|
|
253
258
|
# return a brief list of classifiers.
|
254
259
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
255
260
|
def list_classifiers(verbose: nil)
|
261
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
262
|
+
|
256
263
|
headers = {
|
257
264
|
}
|
258
265
|
sdk_headers = Common.new.get_sdk_headers("watson_vision_combined", "V3", "list_classifiers")
|
@@ -282,6 +289,8 @@ module IBMWatson
|
|
282
289
|
# @param classifier_id [String] The ID of the classifier.
|
283
290
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
284
291
|
def get_classifier(classifier_id:)
|
292
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
293
|
+
|
285
294
|
raise ArgumentError.new("classifier_id must be provided") if classifier_id.nil?
|
286
295
|
|
287
296
|
headers = {
|
@@ -350,6 +359,8 @@ module IBMWatson
|
|
350
359
|
# @param negative_examples_filename [String] The filename for negative_examples.
|
351
360
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
352
361
|
def update_classifier(classifier_id:, positive_examples: nil, negative_examples: nil, negative_examples_filename: nil)
|
362
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
363
|
+
|
353
364
|
raise ArgumentError.new("classifier_id must be provided") if classifier_id.nil?
|
354
365
|
|
355
366
|
raise ArgumentError.new("positive_examples must be a hash") unless positive_examples.nil? || positive_examples.is_a?(Hash)
|
@@ -401,6 +412,8 @@ module IBMWatson
|
|
401
412
|
# @param classifier_id [String] The ID of the classifier.
|
402
413
|
# @return [nil]
|
403
414
|
def delete_classifier(classifier_id:)
|
415
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
416
|
+
|
404
417
|
raise ArgumentError.new("classifier_id must be provided") if classifier_id.nil?
|
405
418
|
|
406
419
|
headers = {
|
@@ -435,6 +448,8 @@ module IBMWatson
|
|
435
448
|
# @param classifier_id [String] The ID of the classifier.
|
436
449
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
437
450
|
def get_core_ml_model(classifier_id:)
|
451
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
452
|
+
|
438
453
|
raise ArgumentError.new("classifier_id must be provided") if classifier_id.nil?
|
439
454
|
|
440
455
|
headers = {
|
@@ -474,6 +489,8 @@ module IBMWatson
|
|
474
489
|
# @param customer_id [String] The customer ID for which all data is to be deleted.
|
475
490
|
# @return [nil]
|
476
491
|
def delete_user_data(customer_id:)
|
492
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
493
|
+
|
477
494
|
raise ArgumentError.new("customer_id must be provided") if customer_id.nil?
|
478
495
|
|
479
496
|
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.19.0-be3b4618-20201113-200858
|
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"
|
@@ -30,34 +37,28 @@ module IBMWatson
|
|
30
37
|
class VisualRecognitionV4 < IBMCloudSdkCore::BaseService
|
31
38
|
include Concurrent::Async
|
32
39
|
DEFAULT_SERVICE_NAME = "visual_recognition"
|
33
|
-
DEFAULT_SERVICE_URL = "https://
|
40
|
+
DEFAULT_SERVICE_URL = "https://api.us-south.visual-recognition.watson.cloud.ibm.com"
|
41
|
+
attr_accessor :version
|
34
42
|
##
|
35
43
|
# @!method initialize(args)
|
36
44
|
# Construct a new client for the Visual Recognition service.
|
37
45
|
#
|
38
46
|
# @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.
|
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 `2019-02-11`.
|
49
49
|
# @option args service_url [String] The base service URL to use when contacting the service.
|
50
50
|
# The base service_url may differ between IBM Cloud regions.
|
51
51
|
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
|
52
52
|
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
|
53
53
|
# any external configuration, if applicable.
|
54
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."
|
55
56
|
@__async_initialized__ = false
|
56
57
|
defaults = {}
|
57
|
-
defaults[:version] = nil
|
58
58
|
defaults[:service_url] = DEFAULT_SERVICE_URL
|
59
59
|
defaults[:service_name] = DEFAULT_SERVICE_NAME
|
60
60
|
defaults[:authenticator] = nil
|
61
|
+
defaults[:version] = nil
|
61
62
|
user_service_url = args[:service_url] unless args[:service_url].nil?
|
62
63
|
args = defaults.merge(args)
|
63
64
|
@version = args[:version]
|
@@ -101,6 +102,8 @@ module IBMWatson
|
|
101
102
|
# @param threshold [Float] The minimum score a feature must have to be returned.
|
102
103
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
103
104
|
def analyze(collection_ids:, features:, images_file: nil, image_url: nil, threshold: nil)
|
105
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
106
|
+
|
104
107
|
raise ArgumentError.new("collection_ids must be provided") if collection_ids.nil?
|
105
108
|
|
106
109
|
raise ArgumentError.new("features must be provided") if features.nil?
|
@@ -170,6 +173,8 @@ module IBMWatson
|
|
170
173
|
# @param description [String] The description of the collection.
|
171
174
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
172
175
|
def create_collection(name: nil, description: 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")
|
@@ -203,6 +208,8 @@ module IBMWatson
|
|
203
208
|
# Retrieves a list of collections for the service instance.
|
204
209
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
205
210
|
def list_collections
|
211
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
212
|
+
|
206
213
|
headers = {
|
207
214
|
}
|
208
215
|
sdk_headers = Common.new.get_sdk_headers("watson_vision_combined", "V4", "list_collections")
|
@@ -231,6 +238,8 @@ module IBMWatson
|
|
231
238
|
# @param collection_id [String] The identifier of the collection.
|
232
239
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
233
240
|
def get_collection(collection_id:)
|
241
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
242
|
+
|
234
243
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
235
244
|
|
236
245
|
headers = {
|
@@ -267,6 +276,8 @@ module IBMWatson
|
|
267
276
|
# @param description [String] The description of the collection.
|
268
277
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
269
278
|
def update_collection(collection_id:, name: nil, description: nil)
|
279
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
280
|
+
|
270
281
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
271
282
|
|
272
283
|
headers = {
|
@@ -303,6 +314,8 @@ module IBMWatson
|
|
303
314
|
# @param collection_id [String] The identifier of the collection.
|
304
315
|
# @return [nil]
|
305
316
|
def delete_collection(collection_id:)
|
317
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
318
|
+
|
306
319
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
307
320
|
|
308
321
|
headers = {
|
@@ -325,6 +338,53 @@ module IBMWatson
|
|
325
338
|
)
|
326
339
|
nil
|
327
340
|
end
|
341
|
+
|
342
|
+
##
|
343
|
+
# @!method get_model_file(collection_id:, feature:, model_format:)
|
344
|
+
# Get a model.
|
345
|
+
# Download a model that you can deploy to detect objects in images. The collection
|
346
|
+
# must include a generated model, which is indicated in the response for the
|
347
|
+
# collection details as `"rscnn_ready": true`. If the value is `false`, train or
|
348
|
+
# retrain the collection to generate the model.
|
349
|
+
#
|
350
|
+
# Currently, the model format is specific to Android apps. For more information
|
351
|
+
# about how to deploy the model to your app, see the [Watson Visual Recognition on
|
352
|
+
# Android](https://github.com/matt-ny/rscnn) project in GitHub.
|
353
|
+
# @param collection_id [String] The identifier of the collection.
|
354
|
+
# @param feature [String] The feature for the model.
|
355
|
+
# @param model_format [String] The format of the returned model.
|
356
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
357
|
+
def get_model_file(collection_id:, feature:, model_format:)
|
358
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
359
|
+
|
360
|
+
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
361
|
+
|
362
|
+
raise ArgumentError.new("feature must be provided") if feature.nil?
|
363
|
+
|
364
|
+
raise ArgumentError.new("model_format must be provided") if model_format.nil?
|
365
|
+
|
366
|
+
headers = {
|
367
|
+
}
|
368
|
+
sdk_headers = Common.new.get_sdk_headers("watson_vision_combined", "V4", "get_model_file")
|
369
|
+
headers.merge!(sdk_headers)
|
370
|
+
|
371
|
+
params = {
|
372
|
+
"version" => @version,
|
373
|
+
"feature" => feature,
|
374
|
+
"model_format" => model_format
|
375
|
+
}
|
376
|
+
|
377
|
+
method_url = "/v4/collections/%s/model" % [ERB::Util.url_encode(collection_id)]
|
378
|
+
|
379
|
+
response = request(
|
380
|
+
method: "GET",
|
381
|
+
url: method_url,
|
382
|
+
headers: headers,
|
383
|
+
params: params,
|
384
|
+
accept_json: false
|
385
|
+
)
|
386
|
+
response
|
387
|
+
end
|
328
388
|
#########################
|
329
389
|
# Images
|
330
390
|
#########################
|
@@ -360,6 +420,8 @@ module IBMWatson
|
|
360
420
|
# than 32 characters.
|
361
421
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
362
422
|
def add_images(collection_id:, images_file: nil, image_url: nil, training_data: nil)
|
423
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
424
|
+
|
363
425
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
364
426
|
|
365
427
|
headers = {
|
@@ -409,6 +471,8 @@ module IBMWatson
|
|
409
471
|
# @param collection_id [String] The identifier of the collection.
|
410
472
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
411
473
|
def list_images(collection_id:)
|
474
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
475
|
+
|
412
476
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
413
477
|
|
414
478
|
headers = {
|
@@ -440,6 +504,8 @@ module IBMWatson
|
|
440
504
|
# @param image_id [String] The identifier of the image.
|
441
505
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
442
506
|
def get_image_details(collection_id:, image_id:)
|
507
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
508
|
+
|
443
509
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
444
510
|
|
445
511
|
raise ArgumentError.new("image_id must be provided") if image_id.nil?
|
@@ -473,6 +539,8 @@ module IBMWatson
|
|
473
539
|
# @param image_id [String] The identifier of the image.
|
474
540
|
# @return [nil]
|
475
541
|
def delete_image(collection_id:, image_id:)
|
542
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
543
|
+
|
476
544
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
477
545
|
|
478
546
|
raise ArgumentError.new("image_id must be provided") if image_id.nil?
|
@@ -509,6 +577,8 @@ module IBMWatson
|
|
509
577
|
# For example, an original 800 x 1000 image is resized to 160 x 200 pixels.
|
510
578
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
511
579
|
def get_jpeg_image(collection_id:, image_id:, size: nil)
|
580
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
581
|
+
|
512
582
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
513
583
|
|
514
584
|
raise ArgumentError.new("image_id must be provided") if image_id.nil?
|
@@ -545,6 +615,8 @@ module IBMWatson
|
|
545
615
|
# @param collection_id [String] The identifier of the collection.
|
546
616
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
547
617
|
def list_object_metadata(collection_id:)
|
618
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
619
|
+
|
548
620
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
549
621
|
|
550
622
|
headers = {
|
@@ -580,6 +652,8 @@ module IBMWatson
|
|
580
652
|
# `sys-`.
|
581
653
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
582
654
|
def update_object_metadata(collection_id:, object:, new_object:)
|
655
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
656
|
+
|
583
657
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
584
658
|
|
585
659
|
raise ArgumentError.new("object must be provided") if object.nil?
|
@@ -620,6 +694,8 @@ module IBMWatson
|
|
620
694
|
# @param object [String] The name of the object.
|
621
695
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
622
696
|
def get_object_metadata(collection_id:, object:)
|
697
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
698
|
+
|
623
699
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
624
700
|
|
625
701
|
raise ArgumentError.new("object must be provided") if object.nil?
|
@@ -654,6 +730,8 @@ module IBMWatson
|
|
654
730
|
# @param object [String] The name of the object.
|
655
731
|
# @return [nil]
|
656
732
|
def delete_object(collection_id:, object:)
|
733
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
734
|
+
|
657
735
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
658
736
|
|
659
737
|
raise ArgumentError.new("object must be provided") if object.nil?
|
@@ -691,6 +769,8 @@ module IBMWatson
|
|
691
769
|
# @param collection_id [String] The identifier of the collection.
|
692
770
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
693
771
|
def train(collection_id:)
|
772
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
773
|
+
|
694
774
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
695
775
|
|
696
776
|
headers = {
|
@@ -732,6 +812,8 @@ module IBMWatson
|
|
732
812
|
# @param objects [Array[TrainingDataObject]] Training data for specific objects.
|
733
813
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
734
814
|
def add_image_training_data(collection_id:, image_id:, objects: nil)
|
815
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
816
|
+
|
735
817
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
736
818
|
|
737
819
|
raise ArgumentError.new("image_id must be provided") if image_id.nil?
|
@@ -767,14 +849,16 @@ module IBMWatson
|
|
767
849
|
# Get training usage.
|
768
850
|
# Information about the completed training events. You can use this information to
|
769
851
|
# determine how close you are to the training limits for the month.
|
770
|
-
# @param start_time [
|
852
|
+
# @param start_time [Time] The earliest day to include training events. Specify dates in YYYY-MM-DD format.
|
771
853
|
# If empty or not specified, the earliest training event is included.
|
772
|
-
# @param end_time [
|
854
|
+
# @param end_time [Time] The most recent day to include training events. Specify dates in YYYY-MM-DD
|
773
855
|
# format. All events for the day are included. If empty or not specified, the
|
774
856
|
# current day is used. Specify the same value as `start_time` to request events for
|
775
857
|
# a single day.
|
776
858
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
777
859
|
def get_training_usage(start_time: nil, end_time: nil)
|
860
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
861
|
+
|
778
862
|
headers = {
|
779
863
|
}
|
780
864
|
sdk_headers = Common.new.get_sdk_headers("watson_vision_combined", "V4", "get_training_usage")
|
@@ -814,6 +898,8 @@ module IBMWatson
|
|
814
898
|
# @param customer_id [String] The customer ID for which all data is to be deleted.
|
815
899
|
# @return [nil]
|
816
900
|
def delete_user_data(customer_id:)
|
901
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
902
|
+
|
817
903
|
raise ArgumentError.new("customer_id must be provided") if customer_id.nil?
|
818
904
|
|
819
905
|
headers = {
|