ibm_watson 1.3.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -5
- data/lib/ibm_watson/assistant_v1.rb +225 -199
- data/lib/ibm_watson/assistant_v2.rb +228 -21
- data/lib/ibm_watson/compare_comply_v1.rb +43 -24
- data/lib/ibm_watson/discovery_v1.rb +144 -19
- data/lib/ibm_watson/discovery_v2.rb +742 -23
- data/lib/ibm_watson/language_translator_v3.rb +216 -64
- data/lib/ibm_watson/natural_language_classifier_v1.rb +11 -3
- data/lib/ibm_watson/natural_language_understanding_v1.rb +32 -26
- data/lib/ibm_watson/personality_insights_v3.rb +34 -19
- data/lib/ibm_watson/speech_to_text_v1.rb +239 -106
- data/lib/ibm_watson/text_to_speech_v1.rb +139 -146
- data/lib/ibm_watson/tone_analyzer_v3.rb +19 -14
- data/lib/ibm_watson/version.rb +1 -1
- data/lib/ibm_watson/visual_recognition_v3.rb +40 -17
- data/lib/ibm_watson/visual_recognition_v4.rb +110 -18
- data/test/integration/test_assistant_v1.rb +9 -0
- data/test/integration/test_assistant_v2.rb +34 -0
- data/test/integration/test_compare_comply_v1.rb +1 -12
- 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 +149 -98
- 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 +3 -3
@@ -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™ Assistant service combines machine learning, natural language
|
18
20
|
# understanding, and an integrated dialog editor to create conversation flows between your
|
19
21
|
# apps and your users.
|
@@ -33,37 +35,36 @@ module IBMWatson
|
|
33
35
|
# The Assistant V2 service.
|
34
36
|
class AssistantV2 < IBMCloudSdkCore::BaseService
|
35
37
|
include Concurrent::Async
|
38
|
+
DEFAULT_SERVICE_NAME = "assistant"
|
39
|
+
DEFAULT_SERVICE_URL = "https://api.us-south.assistant.watson.cloud.ibm.com"
|
40
|
+
attr_accessor :version
|
36
41
|
##
|
37
42
|
# @!method initialize(args)
|
38
43
|
# Construct a new client for the Assistant service.
|
39
44
|
#
|
40
45
|
# @param args [Hash] The args to initialize with
|
41
|
-
# @option args version [String]
|
42
|
-
#
|
43
|
-
# incompatible way, a new minor version of the API is released.
|
44
|
-
# The service uses the API version for the date you specify, or
|
45
|
-
# the most recent version before that date. Note that you should
|
46
|
-
# not programmatically specify the current date at runtime, in
|
47
|
-
# case the API has been updated since your application's release.
|
48
|
-
# Instead, specify a version date that is compatible with your
|
49
|
-
# application, and don't change it until your application is
|
50
|
-
# 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 `2020-04-01`.
|
51
48
|
# @option args service_url [String] The base service URL to use when contacting the service.
|
52
49
|
# The base service_url may differ between IBM Cloud regions.
|
53
50
|
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
|
51
|
+
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
|
52
|
+
# any external configuration, if applicable.
|
54
53
|
def initialize(args = {})
|
55
54
|
@__async_initialized__ = false
|
56
55
|
defaults = {}
|
57
|
-
defaults[:
|
58
|
-
defaults[:
|
56
|
+
defaults[:service_url] = DEFAULT_SERVICE_URL
|
57
|
+
defaults[:service_name] = DEFAULT_SERVICE_NAME
|
59
58
|
defaults[:authenticator] = nil
|
59
|
+
defaults[:version] = nil
|
60
|
+
user_service_url = args[:service_url] unless args[:service_url].nil?
|
60
61
|
args = defaults.merge(args)
|
61
62
|
@version = args[:version]
|
62
63
|
raise ArgumentError.new("version must be provided") if @version.nil?
|
63
64
|
|
64
|
-
args[:service_name] = "assistant"
|
65
65
|
args[:authenticator] = IBMCloudSdkCore::ConfigBasedAuthenticatorFactory.new.get_authenticator(service_name: args[:service_name]) if args[:authenticator].nil?
|
66
66
|
super
|
67
|
+
@service_url = user_service_url unless user_service_url.nil?
|
67
68
|
end
|
68
69
|
|
69
70
|
#########################
|
@@ -88,6 +89,8 @@ module IBMWatson
|
|
88
89
|
def create_session(assistant_id:)
|
89
90
|
raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
|
90
91
|
|
92
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
93
|
+
|
91
94
|
headers = {
|
92
95
|
}
|
93
96
|
sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "create_session")
|
@@ -126,6 +129,8 @@ module IBMWatson
|
|
126
129
|
def delete_session(assistant_id:, session_id:)
|
127
130
|
raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
|
128
131
|
|
132
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
133
|
+
|
129
134
|
raise ArgumentError.new("session_id must be provided") if session_id.nil?
|
130
135
|
|
131
136
|
headers = {
|
@@ -154,10 +159,10 @@ module IBMWatson
|
|
154
159
|
|
155
160
|
##
|
156
161
|
# @!method message(assistant_id:, session_id:, input: nil, context: nil)
|
157
|
-
# Send user input to assistant.
|
158
|
-
# Send user input to an assistant and receive a response
|
159
|
-
#
|
160
|
-
#
|
162
|
+
# Send user input to assistant (stateful).
|
163
|
+
# Send user input to an assistant and receive a response, with conversation state
|
164
|
+
# (including context data) stored by Watson Assistant for the duration of the
|
165
|
+
# session.
|
161
166
|
# @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
|
162
167
|
# Assistant user interface, open the assistant settings and click **API Details**.
|
163
168
|
# For information about creating assistants, see the
|
@@ -166,15 +171,20 @@ module IBMWatson
|
|
166
171
|
# **Note:** Currently, the v2 API does not support creating assistants.
|
167
172
|
# @param session_id [String] Unique identifier of the session.
|
168
173
|
# @param input [MessageInput] An input object that includes the input text.
|
169
|
-
# @param context [MessageContext]
|
170
|
-
#
|
171
|
-
#
|
174
|
+
# @param context [MessageContext] Context data for the conversation. You can use this property to set or modify
|
175
|
+
# context variables, which can also be accessed by dialog nodes. The context is
|
176
|
+
# stored by the assistant on a per-session basis.
|
177
|
+
#
|
178
|
+
# **Note:** The total size of the context data stored for a stateful session cannot
|
179
|
+
# exceed 100KB.
|
172
180
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
173
181
|
def message(assistant_id:, session_id:, input: nil, context: nil)
|
174
182
|
raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
|
175
183
|
|
176
184
|
raise ArgumentError.new("session_id must be provided") if session_id.nil?
|
177
185
|
|
186
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
187
|
+
|
178
188
|
headers = {
|
179
189
|
}
|
180
190
|
sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "message")
|
@@ -201,5 +211,202 @@ module IBMWatson
|
|
201
211
|
)
|
202
212
|
response
|
203
213
|
end
|
214
|
+
|
215
|
+
##
|
216
|
+
# @!method message_stateless(assistant_id:, input: nil, context: nil)
|
217
|
+
# Send user input to assistant (stateless).
|
218
|
+
# Send user input to an assistant and receive a response, with conversation state
|
219
|
+
# (including context data) managed by your application.
|
220
|
+
# @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
|
221
|
+
# Assistant user interface, open the assistant settings and click **API Details**.
|
222
|
+
# For information about creating assistants, see the
|
223
|
+
# [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task).
|
224
|
+
#
|
225
|
+
# **Note:** Currently, the v2 API does not support creating assistants.
|
226
|
+
# @param input [MessageInputStateless] An input object that includes the input text.
|
227
|
+
# @param context [MessageContextStateless] Context data for the conversation. You can use this property to set or modify
|
228
|
+
# context variables, which can also be accessed by dialog nodes. The context is not
|
229
|
+
# stored by the assistant. To maintain session state, include the context from the
|
230
|
+
# previous response.
|
231
|
+
#
|
232
|
+
# **Note:** The total size of the context data for a stateless session cannot exceed
|
233
|
+
# 250KB.
|
234
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
235
|
+
def message_stateless(assistant_id:, input: nil, context: nil)
|
236
|
+
raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
|
237
|
+
|
238
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
239
|
+
|
240
|
+
headers = {
|
241
|
+
}
|
242
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "message_stateless")
|
243
|
+
headers.merge!(sdk_headers)
|
244
|
+
|
245
|
+
params = {
|
246
|
+
"version" => @version
|
247
|
+
}
|
248
|
+
|
249
|
+
data = {
|
250
|
+
"input" => input,
|
251
|
+
"context" => context
|
252
|
+
}
|
253
|
+
|
254
|
+
method_url = "/v2/assistants/%s/message" % [ERB::Util.url_encode(assistant_id)]
|
255
|
+
|
256
|
+
response = request(
|
257
|
+
method: "POST",
|
258
|
+
url: method_url,
|
259
|
+
headers: headers,
|
260
|
+
params: params,
|
261
|
+
json: data,
|
262
|
+
accept_json: true
|
263
|
+
)
|
264
|
+
response
|
265
|
+
end
|
266
|
+
#########################
|
267
|
+
# Logs
|
268
|
+
#########################
|
269
|
+
|
270
|
+
##
|
271
|
+
# @!method list_logs(assistant_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
|
272
|
+
# List log events for an assistant.
|
273
|
+
# List the events from the log of an assistant.
|
274
|
+
#
|
275
|
+
# This method is available only with Premium plans.
|
276
|
+
# @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
|
277
|
+
# Assistant user interface, open the assistant settings and click **API Details**.
|
278
|
+
# For information about creating assistants, see the
|
279
|
+
# [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task).
|
280
|
+
#
|
281
|
+
# **Note:** Currently, the v2 API does not support creating assistants.
|
282
|
+
# @param sort [String] How to sort the returned log events. You can sort by **request_timestamp**. To
|
283
|
+
# reverse the sort order, prefix the parameter value with a minus sign (`-`).
|
284
|
+
# @param filter [String] A cacheable parameter that limits the results to those matching the specified
|
285
|
+
# filter. For more information, see the
|
286
|
+
# [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-reference#filter-reference).
|
287
|
+
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
288
|
+
# @param cursor [String] A token identifying the page of results to retrieve.
|
289
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
290
|
+
def list_logs(assistant_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
|
291
|
+
raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
|
292
|
+
|
293
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
294
|
+
|
295
|
+
headers = {
|
296
|
+
}
|
297
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "list_logs")
|
298
|
+
headers.merge!(sdk_headers)
|
299
|
+
|
300
|
+
params = {
|
301
|
+
"version" => @version,
|
302
|
+
"sort" => sort,
|
303
|
+
"filter" => filter,
|
304
|
+
"page_limit" => page_limit,
|
305
|
+
"cursor" => cursor
|
306
|
+
}
|
307
|
+
|
308
|
+
method_url = "/v2/assistants/%s/logs" % [ERB::Util.url_encode(assistant_id)]
|
309
|
+
|
310
|
+
response = request(
|
311
|
+
method: "GET",
|
312
|
+
url: method_url,
|
313
|
+
headers: headers,
|
314
|
+
params: params,
|
315
|
+
accept_json: true
|
316
|
+
)
|
317
|
+
response
|
318
|
+
end
|
319
|
+
#########################
|
320
|
+
# User data
|
321
|
+
#########################
|
322
|
+
|
323
|
+
##
|
324
|
+
# @!method delete_user_data(customer_id:)
|
325
|
+
# Delete labeled data.
|
326
|
+
# Deletes all data associated with a specified customer ID. The method has no effect
|
327
|
+
# if no data is associated with the customer ID.
|
328
|
+
#
|
329
|
+
# You associate a customer ID with data by passing the `X-Watson-Metadata` header
|
330
|
+
# with a request that passes data. For more information about personal data and
|
331
|
+
# customer IDs, see [Information
|
332
|
+
# security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security).
|
333
|
+
#
|
334
|
+
# This operation is limited to 4 requests per minute. For more information, see
|
335
|
+
# **Rate limiting**.
|
336
|
+
# @param customer_id [String] The customer ID for which all data is to be deleted.
|
337
|
+
# @return [nil]
|
338
|
+
def delete_user_data(customer_id:)
|
339
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
340
|
+
|
341
|
+
raise ArgumentError.new("customer_id must be provided") if customer_id.nil?
|
342
|
+
|
343
|
+
headers = {
|
344
|
+
}
|
345
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "delete_user_data")
|
346
|
+
headers.merge!(sdk_headers)
|
347
|
+
|
348
|
+
params = {
|
349
|
+
"version" => @version,
|
350
|
+
"customer_id" => customer_id
|
351
|
+
}
|
352
|
+
|
353
|
+
method_url = "/v2/user_data"
|
354
|
+
|
355
|
+
request(
|
356
|
+
method: "DELETE",
|
357
|
+
url: method_url,
|
358
|
+
headers: headers,
|
359
|
+
params: params,
|
360
|
+
accept_json: true
|
361
|
+
)
|
362
|
+
nil
|
363
|
+
end
|
364
|
+
#########################
|
365
|
+
# bulkClassify
|
366
|
+
#########################
|
367
|
+
|
368
|
+
##
|
369
|
+
# @!method bulk_classify(skill_id:, input: nil)
|
370
|
+
# Identify intents and entities in multiple user utterances.
|
371
|
+
# Send multiple user inputs to a dialog skill in a single request and receive
|
372
|
+
# information about the intents and entities recognized in each input. This method
|
373
|
+
# is useful for testing and comparing the performance of different skills or skill
|
374
|
+
# versions.
|
375
|
+
#
|
376
|
+
# This method is available only with Premium plans.
|
377
|
+
# @param skill_id [String] Unique identifier of the skill. To find the skill ID in the Watson Assistant user
|
378
|
+
# interface, open the skill settings and click **API Details**.
|
379
|
+
# @param input [Array[BulkClassifyUtterance]] An array of input utterances to classify.
|
380
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
381
|
+
def bulk_classify(skill_id:, input: nil)
|
382
|
+
raise ArgumentError.new("skill_id must be provided") if skill_id.nil?
|
383
|
+
|
384
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
385
|
+
|
386
|
+
headers = {
|
387
|
+
}
|
388
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "bulk_classify")
|
389
|
+
headers.merge!(sdk_headers)
|
390
|
+
|
391
|
+
params = {
|
392
|
+
"version" => @version
|
393
|
+
}
|
394
|
+
|
395
|
+
data = {
|
396
|
+
"input" => input
|
397
|
+
}
|
398
|
+
|
399
|
+
method_url = "/v2/skills/%s/workspace/bulk_classify" % [ERB::Util.url_encode(skill_id)]
|
400
|
+
|
401
|
+
response = request(
|
402
|
+
method: "POST",
|
403
|
+
url: method_url,
|
404
|
+
headers: headers,
|
405
|
+
params: params,
|
406
|
+
json: data,
|
407
|
+
accept_json: true
|
408
|
+
)
|
409
|
+
response
|
410
|
+
end
|
204
411
|
end
|
205
412
|
end
|
@@ -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
|
# IBM Watson™ Compare and Comply analyzes governing documents to provide details
|
18
20
|
# about critical aspects of the documents.
|
19
21
|
|
@@ -29,37 +31,36 @@ module IBMWatson
|
|
29
31
|
# The Compare Comply V1 service.
|
30
32
|
class CompareComplyV1 < IBMCloudSdkCore::BaseService
|
31
33
|
include Concurrent::Async
|
34
|
+
DEFAULT_SERVICE_NAME = "compare_comply"
|
35
|
+
DEFAULT_SERVICE_URL = "https://api.us-south.compare-comply.watson.cloud.ibm.com"
|
36
|
+
attr_accessor :version
|
32
37
|
##
|
33
38
|
# @!method initialize(args)
|
34
39
|
# Construct a new client for the Compare Comply service.
|
35
40
|
#
|
36
41
|
# @param args [Hash] The args to initialize with
|
37
|
-
# @option args version [String]
|
38
|
-
#
|
39
|
-
# incompatible way, a new minor version of the API is released.
|
40
|
-
# The service uses the API version for the date you specify, or
|
41
|
-
# the most recent version before that date. Note that you should
|
42
|
-
# not programmatically specify the current date at runtime, in
|
43
|
-
# case the API has been updated since your application's release.
|
44
|
-
# Instead, specify a version date that is compatible with your
|
45
|
-
# application, and don't change it until your application is
|
46
|
-
# ready for a later version.
|
42
|
+
# @option args version [String] Release date of the version of the API you want to use. Specify dates in
|
43
|
+
# YYYY-MM-DD format. The current version is `2018-10-15`.
|
47
44
|
# @option args service_url [String] The base service URL to use when contacting the service.
|
48
45
|
# The base service_url may differ between IBM Cloud regions.
|
49
46
|
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
|
47
|
+
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
|
48
|
+
# any external configuration, if applicable.
|
50
49
|
def initialize(args = {})
|
51
50
|
@__async_initialized__ = false
|
52
51
|
defaults = {}
|
53
|
-
defaults[:
|
54
|
-
defaults[:
|
52
|
+
defaults[:service_url] = DEFAULT_SERVICE_URL
|
53
|
+
defaults[:service_name] = DEFAULT_SERVICE_NAME
|
55
54
|
defaults[:authenticator] = nil
|
55
|
+
defaults[:version] = nil
|
56
|
+
user_service_url = args[:service_url] unless args[:service_url].nil?
|
56
57
|
args = defaults.merge(args)
|
57
58
|
@version = args[:version]
|
58
59
|
raise ArgumentError.new("version must be provided") if @version.nil?
|
59
60
|
|
60
|
-
args[:service_name] = "compare_comply"
|
61
61
|
args[:authenticator] = IBMCloudSdkCore::ConfigBasedAuthenticatorFactory.new.get_authenticator(service_name: args[:service_name]) if args[:authenticator].nil?
|
62
62
|
super
|
63
|
+
@service_url = user_service_url unless user_service_url.nil?
|
63
64
|
end
|
64
65
|
|
65
66
|
#########################
|
@@ -78,6 +79,8 @@ module IBMWatson
|
|
78
79
|
# standalone methods as well as to the methods' use in batch-processing requests.
|
79
80
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
80
81
|
def convert_to_html(file:, file_content_type: nil, model: nil)
|
82
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
83
|
+
|
81
84
|
raise ArgumentError.new("file must be provided") if file.nil?
|
82
85
|
|
83
86
|
headers = {
|
@@ -125,6 +128,8 @@ module IBMWatson
|
|
125
128
|
# standalone methods as well as to the methods' use in batch-processing requests.
|
126
129
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
127
130
|
def classify_elements(file:, file_content_type: nil, model: nil)
|
131
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
132
|
+
|
128
133
|
raise ArgumentError.new("file must be provided") if file.nil?
|
129
134
|
|
130
135
|
headers = {
|
@@ -172,6 +177,8 @@ module IBMWatson
|
|
172
177
|
# standalone methods as well as to the methods' use in batch-processing requests.
|
173
178
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
174
179
|
def extract_tables(file:, file_content_type: nil, model: nil)
|
180
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
181
|
+
|
175
182
|
raise ArgumentError.new("file must be provided") if file.nil?
|
176
183
|
|
177
184
|
headers = {
|
@@ -223,6 +230,8 @@ module IBMWatson
|
|
223
230
|
# standalone methods as well as to the methods' use in batch-processing requests.
|
224
231
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
225
232
|
def compare_documents(file_1:, file_2:, file_1_content_type: nil, file_2_content_type: nil, file_1_label: nil, file_2_label: nil, model: nil)
|
233
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
234
|
+
|
226
235
|
raise ArgumentError.new("file_1 must be provided") if file_1.nil?
|
227
236
|
|
228
237
|
raise ArgumentError.new("file_2 must be provided") if file_2.nil?
|
@@ -280,6 +289,8 @@ module IBMWatson
|
|
280
289
|
# @param comment [String] An optional comment on or description of the feedback.
|
281
290
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
282
291
|
def add_feedback(feedback_data:, user_id: nil, comment: nil)
|
292
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
293
|
+
|
283
294
|
raise ArgumentError.new("feedback_data must be provided") if feedback_data.nil?
|
284
295
|
|
285
296
|
headers = {
|
@@ -311,15 +322,11 @@ module IBMWatson
|
|
311
322
|
end
|
312
323
|
|
313
324
|
##
|
314
|
-
# @!method list_feedback(feedback_type: nil,
|
325
|
+
# @!method list_feedback(feedback_type: nil, document_title: nil, model_id: nil, model_version: nil, category_removed: nil, category_added: nil, category_not_changed: nil, type_removed: nil, type_added: nil, type_not_changed: nil, page_limit: nil, cursor: nil, sort: nil, include_total: nil)
|
315
326
|
# List the feedback in a document.
|
316
327
|
# Lists the feedback in a document.
|
317
328
|
# @param feedback_type [String] An optional string that filters the output to include only feedback with the
|
318
329
|
# specified feedback type. The only permitted value is `element_classification`.
|
319
|
-
# @param before [Time] An optional string in the format `YYYY-MM-DD` that filters the output to include
|
320
|
-
# only feedback that was added before the specified date.
|
321
|
-
# @param after [Time] An optional string in the format `YYYY-MM-DD` that filters the output to include
|
322
|
-
# only feedback that was added after the specified date.
|
323
330
|
# @param document_title [String] An optional string that filters the output to include only feedback from the
|
324
331
|
# document with the specified `document_title`.
|
325
332
|
# @param model_id [String] An optional string that filters the output to include only feedback with the
|
@@ -356,7 +363,9 @@ module IBMWatson
|
|
356
363
|
# output includes a value called `total` that gives the total count of feedback
|
357
364
|
# created.
|
358
365
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
359
|
-
def list_feedback(feedback_type: nil,
|
366
|
+
def list_feedback(feedback_type: nil, document_title: nil, model_id: nil, model_version: nil, category_removed: nil, category_added: nil, category_not_changed: nil, type_removed: nil, type_added: nil, type_not_changed: nil, page_limit: nil, cursor: nil, sort: nil, include_total: nil)
|
367
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
368
|
+
|
360
369
|
headers = {
|
361
370
|
}
|
362
371
|
sdk_headers = Common.new.get_sdk_headers("compare-comply", "V1", "list_feedback")
|
@@ -365,8 +374,6 @@ module IBMWatson
|
|
365
374
|
params = {
|
366
375
|
"version" => @version,
|
367
376
|
"feedback_type" => feedback_type,
|
368
|
-
"before" => before,
|
369
|
-
"after" => after,
|
370
377
|
"document_title" => document_title,
|
371
378
|
"model_id" => model_id,
|
372
379
|
"model_version" => model_version,
|
@@ -405,6 +412,8 @@ module IBMWatson
|
|
405
412
|
# standalone methods as well as to the methods' use in batch-processing requests.
|
406
413
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
407
414
|
def get_feedback(feedback_id:, model: nil)
|
415
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
416
|
+
|
408
417
|
raise ArgumentError.new("feedback_id must be provided") if feedback_id.nil?
|
409
418
|
|
410
419
|
headers = {
|
@@ -440,6 +449,8 @@ module IBMWatson
|
|
440
449
|
# standalone methods as well as to the methods' use in batch-processing requests.
|
441
450
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
442
451
|
def delete_feedback(feedback_id:, model: nil)
|
452
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
453
|
+
|
443
454
|
raise ArgumentError.new("feedback_id must be provided") if feedback_id.nil?
|
444
455
|
|
445
456
|
headers = {
|
@@ -473,10 +484,10 @@ module IBMWatson
|
|
473
484
|
# Run Compare and Comply methods over a collection of input documents.
|
474
485
|
#
|
475
486
|
# **Important:** Batch processing requires the use of the [IBM Cloud Object Storage
|
476
|
-
# service](https://cloud.ibm.com/docs/
|
487
|
+
# service](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-about#about-ibm-cloud-object-storage).
|
477
488
|
# The use of IBM Cloud Object Storage with Compare and Comply is discussed at [Using
|
478
489
|
# batch
|
479
|
-
# processing](https://cloud.ibm.com/docs/
|
490
|
+
# processing](https://cloud.ibm.com/docs/compare-comply?topic=compare-comply-batching#before-you-batch).
|
480
491
|
# @param function [String] The Compare and Comply method to run across the submitted input documents.
|
481
492
|
# @param input_credentials_file [File] A JSON file containing the input Cloud Object Storage credentials. At a minimum,
|
482
493
|
# the credentials must enable `READ` permissions on the bucket defined by the
|
@@ -498,6 +509,8 @@ module IBMWatson
|
|
498
509
|
# standalone methods as well as to the methods' use in batch-processing requests.
|
499
510
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
500
511
|
def create_batch(function:, input_credentials_file:, input_bucket_location:, input_bucket_name:, output_credentials_file:, output_bucket_location:, output_bucket_name:, model: nil)
|
512
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
513
|
+
|
501
514
|
raise ArgumentError.new("function must be provided") if function.nil?
|
502
515
|
|
503
516
|
raise ArgumentError.new("input_credentials_file must be provided") if input_credentials_file.nil?
|
@@ -562,6 +575,8 @@ module IBMWatson
|
|
562
575
|
# Lists batch-processing jobs submitted by users.
|
563
576
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
564
577
|
def list_batches
|
578
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
579
|
+
|
565
580
|
headers = {
|
566
581
|
}
|
567
582
|
sdk_headers = Common.new.get_sdk_headers("compare-comply", "V1", "list_batches")
|
@@ -590,6 +605,8 @@ module IBMWatson
|
|
590
605
|
# @param batch_id [String] The ID of the batch-processing job whose information you want to retrieve.
|
591
606
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
592
607
|
def get_batch(batch_id:)
|
608
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
609
|
+
|
593
610
|
raise ArgumentError.new("batch_id must be provided") if batch_id.nil?
|
594
611
|
|
595
612
|
headers = {
|
@@ -626,6 +643,8 @@ module IBMWatson
|
|
626
643
|
# standalone methods as well as to the methods' use in batch-processing requests.
|
627
644
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
628
645
|
def update_batch(batch_id:, action:, model: nil)
|
646
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
647
|
+
|
629
648
|
raise ArgumentError.new("batch_id must be provided") if batch_id.nil?
|
630
649
|
|
631
650
|
raise ArgumentError.new("action must be provided") if action.nil?
|