ibm_watson 0.16.1 → 0.17.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 +34 -12
- data/lib/ibm_watson/assistant_v1.rb +745 -720
- data/lib/ibm_watson/assistant_v2.rb +23 -19
- data/lib/ibm_watson/compare_comply_v1.rb +94 -89
- data/lib/ibm_watson/discovery_v1.rb +684 -687
- data/lib/ibm_watson/language_translator_v3.rb +234 -33
- data/lib/ibm_watson/natural_language_classifier_v1.rb +33 -29
- data/lib/ibm_watson/natural_language_understanding_v1.rb +33 -29
- data/lib/ibm_watson/personality_insights_v3.rb +18 -14
- data/lib/ibm_watson/speech_to_text_v1.rb +799 -725
- data/lib/ibm_watson/text_to_speech_v1.rb +201 -196
- data/lib/ibm_watson/tone_analyzer_v3.rb +15 -11
- data/lib/ibm_watson/version.rb +1 -1
- data/lib/ibm_watson/visual_recognition_v3.rb +52 -48
- data/test/integration/test_language_translator_v3.rb +37 -1
- data/test/unit/test_language_translator_v3.rb +201 -16
- data/test/unit/test_speech_to_text_v1.rb +2 -2
- metadata +5 -5
@@ -15,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
|
17
17
|
# The IBM Watson™ Assistant service combines machine learning, natural language
|
18
|
-
# understanding, and integrated dialog
|
18
|
+
# understanding, and an integrated dialog editor to create conversation flows between your
|
19
19
|
# apps and your users.
|
20
20
|
|
21
21
|
require "concurrent"
|
@@ -47,16 +47,16 @@ module IBMWatson
|
|
47
47
|
# ready for a later version.
|
48
48
|
# @option args url [String] The base url to use when contacting the service (e.g.
|
49
49
|
# "https://gateway.watsonplatform.net/assistant/api").
|
50
|
-
# The base url may differ between
|
50
|
+
# The base url may differ between IBM Cloud regions.
|
51
51
|
# @option args username [String] The username used to authenticate with the service.
|
52
52
|
# Username and password credentials are only required to run your
|
53
|
-
# application locally or outside of
|
54
|
-
#
|
53
|
+
# application locally or outside of IBM Cloud. When running on
|
54
|
+
# IBM Cloud, the credentials will be automatically loaded from the
|
55
55
|
# `VCAP_SERVICES` environment variable.
|
56
56
|
# @option args password [String] The password used to authenticate with the service.
|
57
57
|
# Username and password credentials are only required to run your
|
58
|
-
# application locally or outside of
|
59
|
-
#
|
58
|
+
# application locally or outside of IBM Cloud. When running on
|
59
|
+
# IBM Cloud, the credentials will be automatically loaded from the
|
60
60
|
# `VCAP_SERVICES` environment variable.
|
61
61
|
# @option args iam_apikey [String] An API key that can be used to request IAM tokens. If
|
62
62
|
# this API key is provided, the SDK will manage the token and handle the
|
@@ -66,7 +66,9 @@ module IBMWatson
|
|
66
66
|
# it expires or reactively upon receiving a 401 from the service as any requests
|
67
67
|
# made with an expired token will fail.
|
68
68
|
# @option args iam_url [String] An optional URL for the IAM service API. Defaults to
|
69
|
-
# 'https://iam.
|
69
|
+
# 'https://iam.cloud.ibm.com/identity/token'.
|
70
|
+
# @option args iam_client_id [String] An optional client id for the IAM service API.
|
71
|
+
# @option args iam_client_secret [String] An optional client secret for the IAM service API.
|
70
72
|
def initialize(args = {})
|
71
73
|
@__async_initialized__ = false
|
72
74
|
defaults = {}
|
@@ -77,6 +79,8 @@ module IBMWatson
|
|
77
79
|
defaults[:iam_apikey] = nil
|
78
80
|
defaults[:iam_access_token] = nil
|
79
81
|
defaults[:iam_url] = nil
|
82
|
+
defaults[:iam_client_id] = nil
|
83
|
+
defaults[:iam_client_secret] = nil
|
80
84
|
args = defaults.merge(args)
|
81
85
|
args[:vcap_services_name] = "conversation"
|
82
86
|
super
|
@@ -149,6 +153,48 @@ module IBMWatson
|
|
149
153
|
# Workspaces
|
150
154
|
#########################
|
151
155
|
|
156
|
+
##
|
157
|
+
# @!method list_workspaces(page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
158
|
+
# List workspaces.
|
159
|
+
# List the workspaces associated with a Watson Assistant service instance.
|
160
|
+
#
|
161
|
+
# This operation is limited to 500 requests per 30 minutes. For more information,
|
162
|
+
# see **Rate limiting**.
|
163
|
+
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
164
|
+
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
165
|
+
# @param sort [String] The attribute by which returned workspaces will be sorted. To reverse the sort
|
166
|
+
# order, prefix the value with a minus sign (`-`).
|
167
|
+
# @param cursor [String] A token identifying the page of results to retrieve.
|
168
|
+
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
169
|
+
# the response.
|
170
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
171
|
+
def list_workspaces(page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
172
|
+
headers = {
|
173
|
+
}
|
174
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_workspaces")
|
175
|
+
headers.merge!(sdk_headers)
|
176
|
+
|
177
|
+
params = {
|
178
|
+
"version" => @version,
|
179
|
+
"page_limit" => page_limit,
|
180
|
+
"include_count" => include_count,
|
181
|
+
"sort" => sort,
|
182
|
+
"cursor" => cursor,
|
183
|
+
"include_audit" => include_audit
|
184
|
+
}
|
185
|
+
|
186
|
+
method_url = "/v1/workspaces"
|
187
|
+
|
188
|
+
response = request(
|
189
|
+
method: "GET",
|
190
|
+
url: method_url,
|
191
|
+
headers: headers,
|
192
|
+
params: params,
|
193
|
+
accept_json: true
|
194
|
+
)
|
195
|
+
response
|
196
|
+
end
|
197
|
+
|
152
198
|
##
|
153
199
|
# @!method create_workspace(name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil)
|
154
200
|
# Create workspace.
|
@@ -158,9 +204,9 @@ module IBMWatson
|
|
158
204
|
# This operation is limited to 30 requests per 30 minutes. For more information, see
|
159
205
|
# **Rate limiting**.
|
160
206
|
# @param name [String] The name of the workspace. This string cannot contain carriage return, newline, or
|
161
|
-
# tab characters
|
207
|
+
# tab characters.
|
162
208
|
# @param description [String] The description of the workspace. This string cannot contain carriage return,
|
163
|
-
# newline, or tab characters
|
209
|
+
# newline, or tab characters.
|
164
210
|
# @param language [String] The language of the workspace.
|
165
211
|
# @param metadata [Hash] Any metadata related to the workspace.
|
166
212
|
# @param learning_opt_out [Boolean] Whether training data from the workspace (including artifacts such as intents and
|
@@ -209,39 +255,6 @@ module IBMWatson
|
|
209
255
|
response
|
210
256
|
end
|
211
257
|
|
212
|
-
##
|
213
|
-
# @!method delete_workspace(workspace_id:)
|
214
|
-
# Delete workspace.
|
215
|
-
# Delete a workspace from the service instance.
|
216
|
-
#
|
217
|
-
# This operation is limited to 30 requests per 30 minutes. For more information, see
|
218
|
-
# **Rate limiting**.
|
219
|
-
# @param workspace_id [String] Unique identifier of the workspace.
|
220
|
-
# @return [nil]
|
221
|
-
def delete_workspace(workspace_id:)
|
222
|
-
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
223
|
-
|
224
|
-
headers = {
|
225
|
-
}
|
226
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_workspace")
|
227
|
-
headers.merge!(sdk_headers)
|
228
|
-
|
229
|
-
params = {
|
230
|
-
"version" => @version
|
231
|
-
}
|
232
|
-
|
233
|
-
method_url = "/v1/workspaces/%s" % [ERB::Util.url_encode(workspace_id)]
|
234
|
-
|
235
|
-
request(
|
236
|
-
method: "DELETE",
|
237
|
-
url: method_url,
|
238
|
-
headers: headers,
|
239
|
-
params: params,
|
240
|
-
accept_json: true
|
241
|
-
)
|
242
|
-
nil
|
243
|
-
end
|
244
|
-
|
245
258
|
##
|
246
259
|
# @!method get_workspace(workspace_id:, export: nil, include_audit: nil, sort: nil)
|
247
260
|
# Get information about a workspace.
|
@@ -287,48 +300,6 @@ module IBMWatson
|
|
287
300
|
response
|
288
301
|
end
|
289
302
|
|
290
|
-
##
|
291
|
-
# @!method list_workspaces(page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
292
|
-
# List workspaces.
|
293
|
-
# List the workspaces associated with a Watson Assistant service instance.
|
294
|
-
#
|
295
|
-
# This operation is limited to 500 requests per 30 minutes. For more information,
|
296
|
-
# see **Rate limiting**.
|
297
|
-
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
298
|
-
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
299
|
-
# @param sort [String] The attribute by which returned workspaces will be sorted. To reverse the sort
|
300
|
-
# order, prefix the value with a minus sign (`-`).
|
301
|
-
# @param cursor [String] A token identifying the page of results to retrieve.
|
302
|
-
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
303
|
-
# the response.
|
304
|
-
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
305
|
-
def list_workspaces(page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
306
|
-
headers = {
|
307
|
-
}
|
308
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_workspaces")
|
309
|
-
headers.merge!(sdk_headers)
|
310
|
-
|
311
|
-
params = {
|
312
|
-
"version" => @version,
|
313
|
-
"page_limit" => page_limit,
|
314
|
-
"include_count" => include_count,
|
315
|
-
"sort" => sort,
|
316
|
-
"cursor" => cursor,
|
317
|
-
"include_audit" => include_audit
|
318
|
-
}
|
319
|
-
|
320
|
-
method_url = "/v1/workspaces"
|
321
|
-
|
322
|
-
response = request(
|
323
|
-
method: "GET",
|
324
|
-
url: method_url,
|
325
|
-
headers: headers,
|
326
|
-
params: params,
|
327
|
-
accept_json: true
|
328
|
-
)
|
329
|
-
response
|
330
|
-
end
|
331
|
-
|
332
303
|
##
|
333
304
|
# @!method update_workspace(workspace_id:, name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, append: nil)
|
334
305
|
# Update workspace.
|
@@ -339,9 +310,9 @@ module IBMWatson
|
|
339
310
|
# **Rate limiting**.
|
340
311
|
# @param workspace_id [String] Unique identifier of the workspace.
|
341
312
|
# @param name [String] The name of the workspace. This string cannot contain carriage return, newline, or
|
342
|
-
# tab characters
|
313
|
+
# tab characters.
|
343
314
|
# @param description [String] The description of the workspace. This string cannot contain carriage return,
|
344
|
-
# newline, or tab characters
|
315
|
+
# newline, or tab characters.
|
345
316
|
# @param language [String] The language of the workspace.
|
346
317
|
# @param metadata [Hash] Any metadata related to the workspace.
|
347
318
|
# @param learning_opt_out [Boolean] Whether training data from the workspace (including artifacts such as intents and
|
@@ -401,94 +372,143 @@ module IBMWatson
|
|
401
372
|
)
|
402
373
|
response
|
403
374
|
end
|
375
|
+
|
376
|
+
##
|
377
|
+
# @!method delete_workspace(workspace_id:)
|
378
|
+
# Delete workspace.
|
379
|
+
# Delete a workspace from the service instance.
|
380
|
+
#
|
381
|
+
# This operation is limited to 30 requests per 30 minutes. For more information, see
|
382
|
+
# **Rate limiting**.
|
383
|
+
# @param workspace_id [String] Unique identifier of the workspace.
|
384
|
+
# @return [nil]
|
385
|
+
def delete_workspace(workspace_id:)
|
386
|
+
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
387
|
+
|
388
|
+
headers = {
|
389
|
+
}
|
390
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_workspace")
|
391
|
+
headers.merge!(sdk_headers)
|
392
|
+
|
393
|
+
params = {
|
394
|
+
"version" => @version
|
395
|
+
}
|
396
|
+
|
397
|
+
method_url = "/v1/workspaces/%s" % [ERB::Util.url_encode(workspace_id)]
|
398
|
+
|
399
|
+
request(
|
400
|
+
method: "DELETE",
|
401
|
+
url: method_url,
|
402
|
+
headers: headers,
|
403
|
+
params: params,
|
404
|
+
accept_json: true
|
405
|
+
)
|
406
|
+
nil
|
407
|
+
end
|
404
408
|
#########################
|
405
409
|
# Intents
|
406
410
|
#########################
|
407
411
|
|
408
412
|
##
|
409
|
-
# @!method
|
410
|
-
#
|
411
|
-
#
|
413
|
+
# @!method list_intents(workspace_id:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
414
|
+
# List intents.
|
415
|
+
# List the intents for a workspace.
|
412
416
|
#
|
413
|
-
#
|
414
|
-
#
|
417
|
+
# With **export**=`false`, this operation is limited to 2000 requests per 30
|
418
|
+
# minutes. With **export**=`true`, the limit is 400 requests per 30 minutes. For
|
419
|
+
# more information, see **Rate limiting**.
|
415
420
|
# @param workspace_id [String] Unique identifier of the workspace.
|
416
|
-
# @param
|
417
|
-
#
|
418
|
-
#
|
419
|
-
#
|
420
|
-
#
|
421
|
-
# @param
|
422
|
-
#
|
423
|
-
# @param
|
421
|
+
# @param export [Boolean] Whether to include all element content in the returned data. If
|
422
|
+
# **export**=`false`, the returned data includes only information about the element
|
423
|
+
# itself. If **export**=`true`, all content, including subelements, is included.
|
424
|
+
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
425
|
+
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
426
|
+
# @param sort [String] The attribute by which returned intents will be sorted. To reverse the sort order,
|
427
|
+
# prefix the value with a minus sign (`-`).
|
428
|
+
# @param cursor [String] A token identifying the page of results to retrieve.
|
429
|
+
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
430
|
+
# the response.
|
424
431
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
425
|
-
def
|
432
|
+
def list_intents(workspace_id:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
426
433
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
427
434
|
|
428
|
-
raise ArgumentError.new("intent must be provided") if intent.nil?
|
429
|
-
|
430
435
|
headers = {
|
431
436
|
}
|
432
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
437
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_intents")
|
433
438
|
headers.merge!(sdk_headers)
|
434
439
|
|
435
440
|
params = {
|
436
|
-
"version" => @version
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
"
|
441
|
-
"
|
442
|
-
"
|
441
|
+
"version" => @version,
|
442
|
+
"export" => export,
|
443
|
+
"page_limit" => page_limit,
|
444
|
+
"include_count" => include_count,
|
445
|
+
"sort" => sort,
|
446
|
+
"cursor" => cursor,
|
447
|
+
"include_audit" => include_audit
|
443
448
|
}
|
444
449
|
|
445
450
|
method_url = "/v1/workspaces/%s/intents" % [ERB::Util.url_encode(workspace_id)]
|
446
451
|
|
447
452
|
response = request(
|
448
|
-
method: "
|
453
|
+
method: "GET",
|
449
454
|
url: method_url,
|
450
455
|
headers: headers,
|
451
456
|
params: params,
|
452
|
-
json: data,
|
453
457
|
accept_json: true
|
454
458
|
)
|
455
459
|
response
|
456
460
|
end
|
457
461
|
|
458
462
|
##
|
459
|
-
# @!method
|
460
|
-
#
|
461
|
-
#
|
463
|
+
# @!method create_intent(workspace_id:, intent:, description: nil, examples: nil)
|
464
|
+
# Create intent.
|
465
|
+
# Create a new intent.
|
466
|
+
#
|
467
|
+
# If you want to create multiple intents with a single API call, consider using the
|
468
|
+
# **[Update workspace](#update-workspace)** method instead.
|
462
469
|
#
|
463
470
|
# This operation is limited to 2000 requests per 30 minutes. For more information,
|
464
471
|
# see **Rate limiting**.
|
465
472
|
# @param workspace_id [String] Unique identifier of the workspace.
|
466
|
-
# @param intent [String] The intent
|
467
|
-
#
|
468
|
-
|
473
|
+
# @param intent [String] The name of the intent. This string must conform to the following restrictions:
|
474
|
+
# - It can contain only Unicode alphanumeric, underscore, hyphen, and dot
|
475
|
+
# characters.
|
476
|
+
# - It cannot begin with the reserved prefix `sys-`.
|
477
|
+
# @param description [String] The description of the intent. This string cannot contain carriage return,
|
478
|
+
# newline, or tab characters.
|
479
|
+
# @param examples [Array[Example]] An array of user input examples for the intent.
|
480
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
481
|
+
def create_intent(workspace_id:, intent:, description: nil, examples: nil)
|
469
482
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
470
483
|
|
471
484
|
raise ArgumentError.new("intent must be provided") if intent.nil?
|
472
485
|
|
473
486
|
headers = {
|
474
487
|
}
|
475
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
488
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "create_intent")
|
476
489
|
headers.merge!(sdk_headers)
|
477
490
|
|
478
491
|
params = {
|
479
492
|
"version" => @version
|
480
493
|
}
|
481
494
|
|
482
|
-
|
495
|
+
data = {
|
496
|
+
"intent" => intent,
|
497
|
+
"description" => description,
|
498
|
+
"examples" => examples
|
499
|
+
}
|
483
500
|
|
484
|
-
|
485
|
-
|
501
|
+
method_url = "/v1/workspaces/%s/intents" % [ERB::Util.url_encode(workspace_id)]
|
502
|
+
|
503
|
+
response = request(
|
504
|
+
method: "POST",
|
486
505
|
url: method_url,
|
487
506
|
headers: headers,
|
488
507
|
params: params,
|
508
|
+
json: data,
|
489
509
|
accept_json: true
|
490
510
|
)
|
491
|
-
|
511
|
+
response
|
492
512
|
end
|
493
513
|
|
494
514
|
##
|
@@ -536,72 +556,24 @@ module IBMWatson
|
|
536
556
|
end
|
537
557
|
|
538
558
|
##
|
539
|
-
# @!method
|
540
|
-
#
|
541
|
-
#
|
559
|
+
# @!method update_intent(workspace_id:, intent:, new_intent: nil, new_description: nil, new_examples: nil)
|
560
|
+
# Update intent.
|
561
|
+
# Update an existing intent with new or modified data. You must provide component
|
562
|
+
# objects defining the content of the updated intent.
|
542
563
|
#
|
543
|
-
#
|
544
|
-
#
|
545
|
-
#
|
546
|
-
#
|
547
|
-
#
|
548
|
-
# **export**=`false`, the returned data includes only information about the element
|
549
|
-
# itself. If **export**=`true`, all content, including subelements, is included.
|
550
|
-
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
551
|
-
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
552
|
-
# @param sort [String] The attribute by which returned intents will be sorted. To reverse the sort order,
|
553
|
-
# prefix the value with a minus sign (`-`).
|
554
|
-
# @param cursor [String] A token identifying the page of results to retrieve.
|
555
|
-
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
556
|
-
# the response.
|
557
|
-
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
558
|
-
def list_intents(workspace_id:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
559
|
-
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
560
|
-
|
561
|
-
headers = {
|
562
|
-
}
|
563
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_intents")
|
564
|
-
headers.merge!(sdk_headers)
|
565
|
-
|
566
|
-
params = {
|
567
|
-
"version" => @version,
|
568
|
-
"export" => export,
|
569
|
-
"page_limit" => page_limit,
|
570
|
-
"include_count" => include_count,
|
571
|
-
"sort" => sort,
|
572
|
-
"cursor" => cursor,
|
573
|
-
"include_audit" => include_audit
|
574
|
-
}
|
575
|
-
|
576
|
-
method_url = "/v1/workspaces/%s/intents" % [ERB::Util.url_encode(workspace_id)]
|
577
|
-
|
578
|
-
response = request(
|
579
|
-
method: "GET",
|
580
|
-
url: method_url,
|
581
|
-
headers: headers,
|
582
|
-
params: params,
|
583
|
-
accept_json: true
|
584
|
-
)
|
585
|
-
response
|
586
|
-
end
|
587
|
-
|
588
|
-
##
|
589
|
-
# @!method update_intent(workspace_id:, intent:, new_intent: nil, new_description: nil, new_examples: nil)
|
590
|
-
# Update intent.
|
591
|
-
# Update an existing intent with new or modified data. You must provide component
|
592
|
-
# objects defining the content of the updated intent.
|
593
|
-
#
|
594
|
-
# This operation is limited to 2000 requests per 30 minutes. For more information,
|
595
|
-
# see **Rate limiting**.
|
564
|
+
# If you want to update multiple intents with a single API call, consider using the
|
565
|
+
# **[Update workspace](#update-workspace)** method instead.
|
566
|
+
#
|
567
|
+
# This operation is limited to 2000 requests per 30 minutes. For more information,
|
568
|
+
# see **Rate limiting**.
|
596
569
|
# @param workspace_id [String] Unique identifier of the workspace.
|
597
570
|
# @param intent [String] The intent name.
|
598
571
|
# @param new_intent [String] The name of the intent. This string must conform to the following restrictions:
|
599
572
|
# - It can contain only Unicode alphanumeric, underscore, hyphen, and dot
|
600
573
|
# characters.
|
601
574
|
# - It cannot begin with the reserved prefix `sys-`.
|
602
|
-
# - It must be no longer than 128 characters.
|
603
575
|
# @param new_description [String] The description of the intent. This string cannot contain carriage return,
|
604
|
-
# newline, or tab characters
|
576
|
+
# newline, or tab characters.
|
605
577
|
# @param new_examples [Array[Example]] An array of user input examples for the intent.
|
606
578
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
607
579
|
def update_intent(workspace_id:, intent:, new_intent: nil, new_description: nil, new_examples: nil)
|
@@ -636,113 +608,114 @@ module IBMWatson
|
|
636
608
|
)
|
637
609
|
response
|
638
610
|
end
|
639
|
-
#########################
|
640
|
-
# Examples
|
641
|
-
#########################
|
642
611
|
|
643
612
|
##
|
644
|
-
# @!method
|
645
|
-
#
|
646
|
-
#
|
613
|
+
# @!method delete_intent(workspace_id:, intent:)
|
614
|
+
# Delete intent.
|
615
|
+
# Delete an intent from a workspace.
|
647
616
|
#
|
648
|
-
# This operation is limited to
|
617
|
+
# This operation is limited to 2000 requests per 30 minutes. For more information,
|
649
618
|
# see **Rate limiting**.
|
650
619
|
# @param workspace_id [String] Unique identifier of the workspace.
|
651
620
|
# @param intent [String] The intent name.
|
652
|
-
# @
|
653
|
-
|
654
|
-
# - It cannot contain carriage return, newline, or tab characters.
|
655
|
-
# - It cannot consist of only whitespace characters.
|
656
|
-
# - It must be no longer than 1024 characters.
|
657
|
-
# @param mentions [Array[Mention]] An array of contextual entity mentions.
|
658
|
-
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
659
|
-
def create_example(workspace_id:, intent:, text:, mentions: nil)
|
621
|
+
# @return [nil]
|
622
|
+
def delete_intent(workspace_id:, intent:)
|
660
623
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
661
624
|
|
662
625
|
raise ArgumentError.new("intent must be provided") if intent.nil?
|
663
626
|
|
664
|
-
raise ArgumentError.new("text must be provided") if text.nil?
|
665
|
-
|
666
627
|
headers = {
|
667
628
|
}
|
668
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
629
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_intent")
|
669
630
|
headers.merge!(sdk_headers)
|
670
631
|
|
671
632
|
params = {
|
672
633
|
"version" => @version
|
673
634
|
}
|
674
635
|
|
675
|
-
|
676
|
-
"text" => text,
|
677
|
-
"mentions" => mentions
|
678
|
-
}
|
679
|
-
|
680
|
-
method_url = "/v1/workspaces/%s/intents/%s/examples" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
|
636
|
+
method_url = "/v1/workspaces/%s/intents/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
|
681
637
|
|
682
|
-
|
683
|
-
method: "
|
638
|
+
request(
|
639
|
+
method: "DELETE",
|
684
640
|
url: method_url,
|
685
641
|
headers: headers,
|
686
642
|
params: params,
|
687
|
-
json: data,
|
688
643
|
accept_json: true
|
689
644
|
)
|
690
|
-
|
645
|
+
nil
|
691
646
|
end
|
647
|
+
#########################
|
648
|
+
# Examples
|
649
|
+
#########################
|
692
650
|
|
693
651
|
##
|
694
|
-
# @!method
|
695
|
-
#
|
696
|
-
#
|
652
|
+
# @!method list_examples(workspace_id:, intent:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
653
|
+
# List user input examples.
|
654
|
+
# List the user input examples for an intent, optionally including contextual entity
|
655
|
+
# mentions.
|
697
656
|
#
|
698
|
-
# This operation is limited to
|
657
|
+
# This operation is limited to 2500 requests per 30 minutes. For more information,
|
699
658
|
# see **Rate limiting**.
|
700
659
|
# @param workspace_id [String] Unique identifier of the workspace.
|
701
660
|
# @param intent [String] The intent name.
|
702
|
-
# @param
|
703
|
-
# @
|
704
|
-
|
661
|
+
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
662
|
+
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
663
|
+
# @param sort [String] The attribute by which returned examples will be sorted. To reverse the sort
|
664
|
+
# order, prefix the value with a minus sign (`-`).
|
665
|
+
# @param cursor [String] A token identifying the page of results to retrieve.
|
666
|
+
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
667
|
+
# the response.
|
668
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
669
|
+
def list_examples(workspace_id:, intent:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
705
670
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
706
671
|
|
707
672
|
raise ArgumentError.new("intent must be provided") if intent.nil?
|
708
673
|
|
709
|
-
raise ArgumentError.new("text must be provided") if text.nil?
|
710
|
-
|
711
674
|
headers = {
|
712
675
|
}
|
713
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
676
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_examples")
|
714
677
|
headers.merge!(sdk_headers)
|
715
678
|
|
716
679
|
params = {
|
717
|
-
"version" => @version
|
680
|
+
"version" => @version,
|
681
|
+
"page_limit" => page_limit,
|
682
|
+
"include_count" => include_count,
|
683
|
+
"sort" => sort,
|
684
|
+
"cursor" => cursor,
|
685
|
+
"include_audit" => include_audit
|
718
686
|
}
|
719
687
|
|
720
|
-
method_url = "/v1/workspaces/%s/intents/%s/examples
|
688
|
+
method_url = "/v1/workspaces/%s/intents/%s/examples" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
|
721
689
|
|
722
|
-
request(
|
723
|
-
method: "
|
690
|
+
response = request(
|
691
|
+
method: "GET",
|
724
692
|
url: method_url,
|
725
693
|
headers: headers,
|
726
694
|
params: params,
|
727
695
|
accept_json: true
|
728
696
|
)
|
729
|
-
|
697
|
+
response
|
730
698
|
end
|
731
699
|
|
732
700
|
##
|
733
|
-
# @!method
|
734
|
-
#
|
735
|
-
#
|
701
|
+
# @!method create_example(workspace_id:, intent:, text:, mentions: nil)
|
702
|
+
# Create user input example.
|
703
|
+
# Add a new user input example to an intent.
|
736
704
|
#
|
737
|
-
#
|
705
|
+
# If you want to add multiple exaples with a single API call, consider using the
|
706
|
+
# **[Update intent](#update-intent)** method instead.
|
707
|
+
#
|
708
|
+
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
738
709
|
# see **Rate limiting**.
|
739
710
|
# @param workspace_id [String] Unique identifier of the workspace.
|
740
711
|
# @param intent [String] The intent name.
|
741
|
-
# @param text [String] The text of
|
742
|
-
#
|
743
|
-
#
|
712
|
+
# @param text [String] The text of a user input example. This string must conform to the following
|
713
|
+
# restrictions:
|
714
|
+
# - It cannot contain carriage return, newline, or tab characters.
|
715
|
+
# - It cannot consist of only whitespace characters.
|
716
|
+
# @param mentions [Array[Mention]] An array of contextual entity mentions.
|
744
717
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
745
|
-
def
|
718
|
+
def create_example(workspace_id:, intent:, text:, mentions: nil)
|
746
719
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
747
720
|
|
748
721
|
raise ArgumentError.new("intent must be provided") if intent.nil?
|
@@ -751,64 +724,62 @@ module IBMWatson
|
|
751
724
|
|
752
725
|
headers = {
|
753
726
|
}
|
754
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
727
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "create_example")
|
755
728
|
headers.merge!(sdk_headers)
|
756
729
|
|
757
730
|
params = {
|
758
|
-
"version" => @version
|
759
|
-
"include_audit" => include_audit
|
731
|
+
"version" => @version
|
760
732
|
}
|
761
733
|
|
762
|
-
|
734
|
+
data = {
|
735
|
+
"text" => text,
|
736
|
+
"mentions" => mentions
|
737
|
+
}
|
738
|
+
|
739
|
+
method_url = "/v1/workspaces/%s/intents/%s/examples" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
|
763
740
|
|
764
741
|
response = request(
|
765
|
-
method: "
|
742
|
+
method: "POST",
|
766
743
|
url: method_url,
|
767
744
|
headers: headers,
|
768
745
|
params: params,
|
746
|
+
json: data,
|
769
747
|
accept_json: true
|
770
748
|
)
|
771
749
|
response
|
772
750
|
end
|
773
751
|
|
774
752
|
##
|
775
|
-
# @!method
|
776
|
-
#
|
777
|
-
#
|
778
|
-
# mentions.
|
753
|
+
# @!method get_example(workspace_id:, intent:, text:, include_audit: nil)
|
754
|
+
# Get user input example.
|
755
|
+
# Get information about a user input example.
|
779
756
|
#
|
780
|
-
# This operation is limited to
|
757
|
+
# This operation is limited to 6000 requests per 5 minutes. For more information,
|
781
758
|
# see **Rate limiting**.
|
782
759
|
# @param workspace_id [String] Unique identifier of the workspace.
|
783
760
|
# @param intent [String] The intent name.
|
784
|
-
# @param
|
785
|
-
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
786
|
-
# @param sort [String] The attribute by which returned examples will be sorted. To reverse the sort
|
787
|
-
# order, prefix the value with a minus sign (`-`).
|
788
|
-
# @param cursor [String] A token identifying the page of results to retrieve.
|
761
|
+
# @param text [String] The text of the user input example.
|
789
762
|
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
790
763
|
# the response.
|
791
764
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
792
|
-
def
|
765
|
+
def get_example(workspace_id:, intent:, text:, include_audit: nil)
|
793
766
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
794
767
|
|
795
768
|
raise ArgumentError.new("intent must be provided") if intent.nil?
|
796
769
|
|
770
|
+
raise ArgumentError.new("text must be provided") if text.nil?
|
771
|
+
|
797
772
|
headers = {
|
798
773
|
}
|
799
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
774
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "get_example")
|
800
775
|
headers.merge!(sdk_headers)
|
801
776
|
|
802
777
|
params = {
|
803
778
|
"version" => @version,
|
804
|
-
"page_limit" => page_limit,
|
805
|
-
"include_count" => include_count,
|
806
|
-
"sort" => sort,
|
807
|
-
"cursor" => cursor,
|
808
779
|
"include_audit" => include_audit
|
809
780
|
}
|
810
781
|
|
811
|
-
method_url = "/v1/workspaces/%s/intents/%s/examples" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
|
782
|
+
method_url = "/v1/workspaces/%s/intents/%s/examples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent), ERB::Util.url_encode(text)]
|
812
783
|
|
813
784
|
response = request(
|
814
785
|
method: "GET",
|
@@ -825,6 +796,9 @@ module IBMWatson
|
|
825
796
|
# Update user input example.
|
826
797
|
# Update the text of a user input example.
|
827
798
|
#
|
799
|
+
# If you want to update multiple examples with a single API call, consider using the
|
800
|
+
# **[Update intent](#update-intent)** method instead.
|
801
|
+
#
|
828
802
|
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
829
803
|
# see **Rate limiting**.
|
830
804
|
# @param workspace_id [String] Unique identifier of the workspace.
|
@@ -834,7 +808,6 @@ module IBMWatson
|
|
834
808
|
# restrictions:
|
835
809
|
# - It cannot contain carriage return, newline, or tab characters.
|
836
810
|
# - It cannot consist of only whitespace characters.
|
837
|
-
# - It must be no longer than 1024 characters.
|
838
811
|
# @param new_mentions [Array[Mention]] An array of contextual entity mentions.
|
839
812
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
840
813
|
def update_example(workspace_id:, intent:, text:, new_text: nil, new_mentions: nil)
|
@@ -870,168 +843,172 @@ module IBMWatson
|
|
870
843
|
)
|
871
844
|
response
|
872
845
|
end
|
873
|
-
#########################
|
874
|
-
# Counterexamples
|
875
|
-
#########################
|
876
846
|
|
877
847
|
##
|
878
|
-
# @!method
|
879
|
-
#
|
880
|
-
#
|
881
|
-
# been marked as irrelevant input.
|
848
|
+
# @!method delete_example(workspace_id:, intent:, text:)
|
849
|
+
# Delete user input example.
|
850
|
+
# Delete a user input example from an intent.
|
882
851
|
#
|
883
852
|
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
884
853
|
# see **Rate limiting**.
|
885
854
|
# @param workspace_id [String] Unique identifier of the workspace.
|
886
|
-
# @param
|
887
|
-
#
|
888
|
-
#
|
889
|
-
|
890
|
-
# - It must be no longer than 1024 characters.
|
891
|
-
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
892
|
-
def create_counterexample(workspace_id:, text:)
|
855
|
+
# @param intent [String] The intent name.
|
856
|
+
# @param text [String] The text of the user input example.
|
857
|
+
# @return [nil]
|
858
|
+
def delete_example(workspace_id:, intent:, text:)
|
893
859
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
894
860
|
|
861
|
+
raise ArgumentError.new("intent must be provided") if intent.nil?
|
862
|
+
|
895
863
|
raise ArgumentError.new("text must be provided") if text.nil?
|
896
864
|
|
897
865
|
headers = {
|
898
866
|
}
|
899
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
867
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_example")
|
900
868
|
headers.merge!(sdk_headers)
|
901
869
|
|
902
870
|
params = {
|
903
871
|
"version" => @version
|
904
872
|
}
|
905
873
|
|
906
|
-
|
907
|
-
"text" => text
|
908
|
-
}
|
909
|
-
|
910
|
-
method_url = "/v1/workspaces/%s/counterexamples" % [ERB::Util.url_encode(workspace_id)]
|
874
|
+
method_url = "/v1/workspaces/%s/intents/%s/examples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent), ERB::Util.url_encode(text)]
|
911
875
|
|
912
|
-
|
913
|
-
method: "
|
876
|
+
request(
|
877
|
+
method: "DELETE",
|
914
878
|
url: method_url,
|
915
879
|
headers: headers,
|
916
880
|
params: params,
|
917
|
-
json: data,
|
918
881
|
accept_json: true
|
919
882
|
)
|
920
|
-
|
883
|
+
nil
|
921
884
|
end
|
885
|
+
#########################
|
886
|
+
# Counterexamples
|
887
|
+
#########################
|
922
888
|
|
923
889
|
##
|
924
|
-
# @!method
|
925
|
-
#
|
926
|
-
#
|
890
|
+
# @!method list_counterexamples(workspace_id:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
891
|
+
# List counterexamples.
|
892
|
+
# List the counterexamples for a workspace. Counterexamples are examples that have
|
927
893
|
# been marked as irrelevant input.
|
928
894
|
#
|
929
|
-
# This operation is limited to
|
895
|
+
# This operation is limited to 2500 requests per 30 minutes. For more information,
|
930
896
|
# see **Rate limiting**.
|
931
897
|
# @param workspace_id [String] Unique identifier of the workspace.
|
932
|
-
# @param
|
933
|
-
# @
|
934
|
-
|
898
|
+
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
899
|
+
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
900
|
+
# @param sort [String] The attribute by which returned counterexamples will be sorted. To reverse the
|
901
|
+
# sort order, prefix the value with a minus sign (`-`).
|
902
|
+
# @param cursor [String] A token identifying the page of results to retrieve.
|
903
|
+
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
904
|
+
# the response.
|
905
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
906
|
+
def list_counterexamples(workspace_id:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
935
907
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
936
908
|
|
937
|
-
raise ArgumentError.new("text must be provided") if text.nil?
|
938
|
-
|
939
909
|
headers = {
|
940
910
|
}
|
941
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
911
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_counterexamples")
|
942
912
|
headers.merge!(sdk_headers)
|
943
913
|
|
944
914
|
params = {
|
945
|
-
"version" => @version
|
915
|
+
"version" => @version,
|
916
|
+
"page_limit" => page_limit,
|
917
|
+
"include_count" => include_count,
|
918
|
+
"sort" => sort,
|
919
|
+
"cursor" => cursor,
|
920
|
+
"include_audit" => include_audit
|
946
921
|
}
|
947
922
|
|
948
|
-
method_url = "/v1/workspaces/%s/counterexamples
|
923
|
+
method_url = "/v1/workspaces/%s/counterexamples" % [ERB::Util.url_encode(workspace_id)]
|
949
924
|
|
950
|
-
request(
|
951
|
-
method: "
|
925
|
+
response = request(
|
926
|
+
method: "GET",
|
952
927
|
url: method_url,
|
953
928
|
headers: headers,
|
954
929
|
params: params,
|
955
930
|
accept_json: true
|
956
931
|
)
|
957
|
-
|
932
|
+
response
|
958
933
|
end
|
959
934
|
|
960
935
|
##
|
961
|
-
# @!method
|
962
|
-
#
|
963
|
-
#
|
936
|
+
# @!method create_counterexample(workspace_id:, text:)
|
937
|
+
# Create counterexample.
|
938
|
+
# Add a new counterexample to a workspace. Counterexamples are examples that have
|
964
939
|
# been marked as irrelevant input.
|
965
940
|
#
|
966
|
-
#
|
941
|
+
# If you want to add multiple counterexamples with a single API call, consider using
|
942
|
+
# the **[Update workspace](#update-workspace)** method instead.
|
943
|
+
#
|
944
|
+
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
967
945
|
# see **Rate limiting**.
|
968
946
|
# @param workspace_id [String] Unique identifier of the workspace.
|
969
|
-
# @param text [String] The text of a user input
|
970
|
-
#
|
971
|
-
#
|
947
|
+
# @param text [String] The text of a user input marked as irrelevant input. This string must conform to
|
948
|
+
# the following restrictions:
|
949
|
+
# - It cannot contain carriage return, newline, or tab characters.
|
950
|
+
# - It cannot consist of only whitespace characters.
|
972
951
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
973
|
-
def
|
952
|
+
def create_counterexample(workspace_id:, text:)
|
974
953
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
975
954
|
|
976
955
|
raise ArgumentError.new("text must be provided") if text.nil?
|
977
956
|
|
978
957
|
headers = {
|
979
958
|
}
|
980
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
959
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "create_counterexample")
|
981
960
|
headers.merge!(sdk_headers)
|
982
961
|
|
983
962
|
params = {
|
984
|
-
"version" => @version
|
985
|
-
"include_audit" => include_audit
|
963
|
+
"version" => @version
|
986
964
|
}
|
987
965
|
|
988
|
-
|
966
|
+
data = {
|
967
|
+
"text" => text
|
968
|
+
}
|
969
|
+
|
970
|
+
method_url = "/v1/workspaces/%s/counterexamples" % [ERB::Util.url_encode(workspace_id)]
|
989
971
|
|
990
972
|
response = request(
|
991
|
-
method: "
|
973
|
+
method: "POST",
|
992
974
|
url: method_url,
|
993
975
|
headers: headers,
|
994
976
|
params: params,
|
977
|
+
json: data,
|
995
978
|
accept_json: true
|
996
979
|
)
|
997
980
|
response
|
998
981
|
end
|
999
982
|
|
1000
983
|
##
|
1001
|
-
# @!method
|
1002
|
-
#
|
1003
|
-
#
|
984
|
+
# @!method get_counterexample(workspace_id:, text:, include_audit: nil)
|
985
|
+
# Get counterexample.
|
986
|
+
# Get information about a counterexample. Counterexamples are examples that have
|
1004
987
|
# been marked as irrelevant input.
|
1005
988
|
#
|
1006
|
-
# This operation is limited to
|
989
|
+
# This operation is limited to 6000 requests per 5 minutes. For more information,
|
1007
990
|
# see **Rate limiting**.
|
1008
991
|
# @param workspace_id [String] Unique identifier of the workspace.
|
1009
|
-
# @param
|
1010
|
-
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
1011
|
-
# @param sort [String] The attribute by which returned counterexamples will be sorted. To reverse the
|
1012
|
-
# sort order, prefix the value with a minus sign (`-`).
|
1013
|
-
# @param cursor [String] A token identifying the page of results to retrieve.
|
992
|
+
# @param text [String] The text of a user input counterexample (for example, `What are you wearing?`).
|
1014
993
|
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
1015
994
|
# the response.
|
1016
995
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1017
|
-
def
|
996
|
+
def get_counterexample(workspace_id:, text:, include_audit: nil)
|
1018
997
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1019
998
|
|
999
|
+
raise ArgumentError.new("text must be provided") if text.nil?
|
1000
|
+
|
1020
1001
|
headers = {
|
1021
1002
|
}
|
1022
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
1003
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "get_counterexample")
|
1023
1004
|
headers.merge!(sdk_headers)
|
1024
1005
|
|
1025
1006
|
params = {
|
1026
1007
|
"version" => @version,
|
1027
|
-
"page_limit" => page_limit,
|
1028
|
-
"include_count" => include_count,
|
1029
|
-
"sort" => sort,
|
1030
|
-
"cursor" => cursor,
|
1031
1008
|
"include_audit" => include_audit
|
1032
1009
|
}
|
1033
1010
|
|
1034
|
-
method_url = "/v1/workspaces/%s/counterexamples" % [ERB::Util.url_encode(workspace_id)]
|
1011
|
+
method_url = "/v1/workspaces/%s/counterexamples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(text)]
|
1035
1012
|
|
1036
1013
|
response = request(
|
1037
1014
|
method: "GET",
|
@@ -1049,15 +1026,17 @@ module IBMWatson
|
|
1049
1026
|
# Update the text of a counterexample. Counterexamples are examples that have been
|
1050
1027
|
# marked as irrelevant input.
|
1051
1028
|
#
|
1029
|
+
# If you want to update multiple counterexamples with a single API call, consider
|
1030
|
+
# using the **[Update workspace](#update-workspace)** method instead.
|
1031
|
+
#
|
1052
1032
|
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
1053
1033
|
# see **Rate limiting**.
|
1054
1034
|
# @param workspace_id [String] Unique identifier of the workspace.
|
1055
1035
|
# @param text [String] The text of a user input counterexample (for example, `What are you wearing?`).
|
1056
1036
|
# @param new_text [String] The text of a user input marked as irrelevant input. This string must conform to
|
1057
1037
|
# the following restrictions:
|
1058
|
-
# - It cannot contain carriage return, newline, or tab characters
|
1059
|
-
# - It cannot consist of only whitespace characters
|
1060
|
-
# - It must be no longer than 1024 characters.
|
1038
|
+
# - It cannot contain carriage return, newline, or tab characters.
|
1039
|
+
# - It cannot consist of only whitespace characters.
|
1061
1040
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1062
1041
|
def update_counterexample(workspace_id:, text:, new_text: nil)
|
1063
1042
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
@@ -1089,27 +1068,115 @@ module IBMWatson
|
|
1089
1068
|
)
|
1090
1069
|
response
|
1091
1070
|
end
|
1071
|
+
|
1072
|
+
##
|
1073
|
+
# @!method delete_counterexample(workspace_id:, text:)
|
1074
|
+
# Delete counterexample.
|
1075
|
+
# Delete a counterexample from a workspace. Counterexamples are examples that have
|
1076
|
+
# been marked as irrelevant input.
|
1077
|
+
#
|
1078
|
+
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
1079
|
+
# see **Rate limiting**.
|
1080
|
+
# @param workspace_id [String] Unique identifier of the workspace.
|
1081
|
+
# @param text [String] The text of a user input counterexample (for example, `What are you wearing?`).
|
1082
|
+
# @return [nil]
|
1083
|
+
def delete_counterexample(workspace_id:, text:)
|
1084
|
+
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1085
|
+
|
1086
|
+
raise ArgumentError.new("text must be provided") if text.nil?
|
1087
|
+
|
1088
|
+
headers = {
|
1089
|
+
}
|
1090
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_counterexample")
|
1091
|
+
headers.merge!(sdk_headers)
|
1092
|
+
|
1093
|
+
params = {
|
1094
|
+
"version" => @version
|
1095
|
+
}
|
1096
|
+
|
1097
|
+
method_url = "/v1/workspaces/%s/counterexamples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(text)]
|
1098
|
+
|
1099
|
+
request(
|
1100
|
+
method: "DELETE",
|
1101
|
+
url: method_url,
|
1102
|
+
headers: headers,
|
1103
|
+
params: params,
|
1104
|
+
accept_json: true
|
1105
|
+
)
|
1106
|
+
nil
|
1107
|
+
end
|
1092
1108
|
#########################
|
1093
1109
|
# Entities
|
1094
1110
|
#########################
|
1095
1111
|
|
1112
|
+
##
|
1113
|
+
# @!method list_entities(workspace_id:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
1114
|
+
# List entities.
|
1115
|
+
# List the entities for a workspace.
|
1116
|
+
#
|
1117
|
+
# With **export**=`false`, this operation is limited to 1000 requests per 30
|
1118
|
+
# minutes. With **export**=`true`, the limit is 200 requests per 30 minutes. For
|
1119
|
+
# more information, see **Rate limiting**.
|
1120
|
+
# @param workspace_id [String] Unique identifier of the workspace.
|
1121
|
+
# @param export [Boolean] Whether to include all element content in the returned data. If
|
1122
|
+
# **export**=`false`, the returned data includes only information about the element
|
1123
|
+
# itself. If **export**=`true`, all content, including subelements, is included.
|
1124
|
+
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
1125
|
+
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
1126
|
+
# @param sort [String] The attribute by which returned entities will be sorted. To reverse the sort
|
1127
|
+
# order, prefix the value with a minus sign (`-`).
|
1128
|
+
# @param cursor [String] A token identifying the page of results to retrieve.
|
1129
|
+
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
1130
|
+
# the response.
|
1131
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1132
|
+
def list_entities(workspace_id:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
1133
|
+
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1134
|
+
|
1135
|
+
headers = {
|
1136
|
+
}
|
1137
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_entities")
|
1138
|
+
headers.merge!(sdk_headers)
|
1139
|
+
|
1140
|
+
params = {
|
1141
|
+
"version" => @version,
|
1142
|
+
"export" => export,
|
1143
|
+
"page_limit" => page_limit,
|
1144
|
+
"include_count" => include_count,
|
1145
|
+
"sort" => sort,
|
1146
|
+
"cursor" => cursor,
|
1147
|
+
"include_audit" => include_audit
|
1148
|
+
}
|
1149
|
+
|
1150
|
+
method_url = "/v1/workspaces/%s/entities" % [ERB::Util.url_encode(workspace_id)]
|
1151
|
+
|
1152
|
+
response = request(
|
1153
|
+
method: "GET",
|
1154
|
+
url: method_url,
|
1155
|
+
headers: headers,
|
1156
|
+
params: params,
|
1157
|
+
accept_json: true
|
1158
|
+
)
|
1159
|
+
response
|
1160
|
+
end
|
1161
|
+
|
1096
1162
|
##
|
1097
1163
|
# @!method create_entity(workspace_id:, entity:, description: nil, metadata: nil, fuzzy_match: nil, values: nil)
|
1098
1164
|
# Create entity.
|
1099
1165
|
# Create a new entity, or enable a system entity.
|
1100
1166
|
#
|
1167
|
+
# If you want to create multiple entities with a single API call, consider using the
|
1168
|
+
# **[Update workspace](#update-workspace)** method instead.
|
1169
|
+
#
|
1101
1170
|
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
1102
1171
|
# see **Rate limiting**.
|
1103
1172
|
# @param workspace_id [String] Unique identifier of the workspace.
|
1104
1173
|
# @param entity [String] The name of the entity. This string must conform to the following restrictions:
|
1105
1174
|
# - It can contain only Unicode alphanumeric, underscore, and hyphen characters.
|
1106
|
-
# -
|
1107
|
-
#
|
1108
|
-
# If you specify an entity name beginning with the reserved prefix `sys-`, it must
|
1175
|
+
# - If you specify an entity name beginning with the reserved prefix `sys-`, it must
|
1109
1176
|
# be the name of a system entity that you want to enable. (Any entity content
|
1110
1177
|
# specified with the request is ignored.).
|
1111
1178
|
# @param description [String] The description of the entity. This string cannot contain carriage return,
|
1112
|
-
# newline, or tab characters
|
1179
|
+
# newline, or tab characters.
|
1113
1180
|
# @param metadata [Hash] Any metadata related to the entity.
|
1114
1181
|
# @param fuzzy_match [Boolean] Whether to use fuzzy matching for the entity.
|
1115
1182
|
# @param values [Array[CreateValue]] An array of objects describing the entity values.
|
@@ -1150,226 +1217,233 @@ module IBMWatson
|
|
1150
1217
|
end
|
1151
1218
|
|
1152
1219
|
##
|
1153
|
-
# @!method
|
1154
|
-
#
|
1155
|
-
#
|
1220
|
+
# @!method get_entity(workspace_id:, entity:, export: nil, include_audit: nil)
|
1221
|
+
# Get entity.
|
1222
|
+
# Get information about an entity, optionally including all entity content.
|
1156
1223
|
#
|
1157
|
-
#
|
1158
|
-
#
|
1224
|
+
# With **export**=`false`, this operation is limited to 6000 requests per 5 minutes.
|
1225
|
+
# With **export**=`true`, the limit is 200 requests per 30 minutes. For more
|
1226
|
+
# information, see **Rate limiting**.
|
1159
1227
|
# @param workspace_id [String] Unique identifier of the workspace.
|
1160
1228
|
# @param entity [String] The name of the entity.
|
1161
|
-
# @
|
1162
|
-
|
1229
|
+
# @param export [Boolean] Whether to include all element content in the returned data. If
|
1230
|
+
# **export**=`false`, the returned data includes only information about the element
|
1231
|
+
# itself. If **export**=`true`, all content, including subelements, is included.
|
1232
|
+
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
1233
|
+
# the response.
|
1234
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1235
|
+
def get_entity(workspace_id:, entity:, export: nil, include_audit: nil)
|
1163
1236
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1164
1237
|
|
1165
1238
|
raise ArgumentError.new("entity must be provided") if entity.nil?
|
1166
1239
|
|
1167
1240
|
headers = {
|
1168
1241
|
}
|
1169
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
1242
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "get_entity")
|
1170
1243
|
headers.merge!(sdk_headers)
|
1171
1244
|
|
1172
1245
|
params = {
|
1173
|
-
"version" => @version
|
1246
|
+
"version" => @version,
|
1247
|
+
"export" => export,
|
1248
|
+
"include_audit" => include_audit
|
1174
1249
|
}
|
1175
1250
|
|
1176
1251
|
method_url = "/v1/workspaces/%s/entities/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
|
1177
1252
|
|
1178
|
-
request(
|
1179
|
-
method: "
|
1253
|
+
response = request(
|
1254
|
+
method: "GET",
|
1180
1255
|
url: method_url,
|
1181
1256
|
headers: headers,
|
1182
1257
|
params: params,
|
1183
1258
|
accept_json: true
|
1184
1259
|
)
|
1185
|
-
|
1260
|
+
response
|
1186
1261
|
end
|
1187
1262
|
|
1188
1263
|
##
|
1189
|
-
# @!method
|
1190
|
-
#
|
1191
|
-
#
|
1264
|
+
# @!method update_entity(workspace_id:, entity:, new_entity: nil, new_description: nil, new_metadata: nil, new_fuzzy_match: nil, new_values: nil)
|
1265
|
+
# Update entity.
|
1266
|
+
# Update an existing entity with new or modified data. You must provide component
|
1267
|
+
# objects defining the content of the updated entity.
|
1192
1268
|
#
|
1193
|
-
#
|
1194
|
-
#
|
1195
|
-
#
|
1269
|
+
# If you want to update multiple entities with a single API call, consider using the
|
1270
|
+
# **[Update workspace](#update-workspace)** method instead.
|
1271
|
+
#
|
1272
|
+
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
1273
|
+
# see **Rate limiting**.
|
1196
1274
|
# @param workspace_id [String] Unique identifier of the workspace.
|
1197
1275
|
# @param entity [String] The name of the entity.
|
1198
|
-
# @param
|
1199
|
-
#
|
1200
|
-
#
|
1201
|
-
# @param
|
1202
|
-
#
|
1276
|
+
# @param new_entity [String] The name of the entity. This string must conform to the following restrictions:
|
1277
|
+
# - It can contain only Unicode alphanumeric, underscore, and hyphen characters.
|
1278
|
+
# - It cannot begin with the reserved prefix `sys-`.
|
1279
|
+
# @param new_description [String] The description of the entity. This string cannot contain carriage return,
|
1280
|
+
# newline, or tab characters.
|
1281
|
+
# @param new_metadata [Hash] Any metadata related to the entity.
|
1282
|
+
# @param new_fuzzy_match [Boolean] Whether to use fuzzy matching for the entity.
|
1283
|
+
# @param new_values [Array[CreateValue]] An array of objects describing the entity values.
|
1203
1284
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1204
|
-
def
|
1285
|
+
def update_entity(workspace_id:, entity:, new_entity: nil, new_description: nil, new_metadata: nil, new_fuzzy_match: nil, new_values: nil)
|
1205
1286
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1206
1287
|
|
1207
1288
|
raise ArgumentError.new("entity must be provided") if entity.nil?
|
1208
1289
|
|
1209
1290
|
headers = {
|
1210
1291
|
}
|
1211
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
1292
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "update_entity")
|
1212
1293
|
headers.merge!(sdk_headers)
|
1213
1294
|
|
1214
1295
|
params = {
|
1215
|
-
"version" => @version
|
1216
|
-
|
1217
|
-
|
1296
|
+
"version" => @version
|
1297
|
+
}
|
1298
|
+
|
1299
|
+
data = {
|
1300
|
+
"entity" => new_entity,
|
1301
|
+
"description" => new_description,
|
1302
|
+
"metadata" => new_metadata,
|
1303
|
+
"fuzzy_match" => new_fuzzy_match,
|
1304
|
+
"values" => new_values
|
1218
1305
|
}
|
1219
1306
|
|
1220
1307
|
method_url = "/v1/workspaces/%s/entities/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
|
1221
1308
|
|
1222
1309
|
response = request(
|
1223
|
-
method: "
|
1310
|
+
method: "POST",
|
1224
1311
|
url: method_url,
|
1225
1312
|
headers: headers,
|
1226
1313
|
params: params,
|
1314
|
+
json: data,
|
1227
1315
|
accept_json: true
|
1228
1316
|
)
|
1229
1317
|
response
|
1230
1318
|
end
|
1231
1319
|
|
1232
1320
|
##
|
1233
|
-
# @!method
|
1234
|
-
#
|
1235
|
-
#
|
1321
|
+
# @!method delete_entity(workspace_id:, entity:)
|
1322
|
+
# Delete entity.
|
1323
|
+
# Delete an entity from a workspace, or disable a system entity.
|
1236
1324
|
#
|
1237
|
-
#
|
1238
|
-
#
|
1239
|
-
# more information, see **Rate limiting**.
|
1325
|
+
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
1326
|
+
# see **Rate limiting**.
|
1240
1327
|
# @param workspace_id [String] Unique identifier of the workspace.
|
1241
|
-
# @param
|
1242
|
-
#
|
1243
|
-
|
1244
|
-
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
1245
|
-
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
1246
|
-
# @param sort [String] The attribute by which returned entities will be sorted. To reverse the sort
|
1247
|
-
# order, prefix the value with a minus sign (`-`).
|
1248
|
-
# @param cursor [String] A token identifying the page of results to retrieve.
|
1249
|
-
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
1250
|
-
# the response.
|
1251
|
-
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1252
|
-
def list_entities(workspace_id:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
1328
|
+
# @param entity [String] The name of the entity.
|
1329
|
+
# @return [nil]
|
1330
|
+
def delete_entity(workspace_id:, entity:)
|
1253
1331
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1254
1332
|
|
1333
|
+
raise ArgumentError.new("entity must be provided") if entity.nil?
|
1334
|
+
|
1255
1335
|
headers = {
|
1256
1336
|
}
|
1257
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
1337
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_entity")
|
1258
1338
|
headers.merge!(sdk_headers)
|
1259
1339
|
|
1260
1340
|
params = {
|
1261
|
-
"version" => @version
|
1262
|
-
"export" => export,
|
1263
|
-
"page_limit" => page_limit,
|
1264
|
-
"include_count" => include_count,
|
1265
|
-
"sort" => sort,
|
1266
|
-
"cursor" => cursor,
|
1267
|
-
"include_audit" => include_audit
|
1341
|
+
"version" => @version
|
1268
1342
|
}
|
1269
1343
|
|
1270
|
-
method_url = "/v1/workspaces/%s/entities" % [ERB::Util.url_encode(workspace_id)]
|
1344
|
+
method_url = "/v1/workspaces/%s/entities/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
|
1271
1345
|
|
1272
|
-
|
1273
|
-
method: "
|
1346
|
+
request(
|
1347
|
+
method: "DELETE",
|
1274
1348
|
url: method_url,
|
1275
1349
|
headers: headers,
|
1276
1350
|
params: params,
|
1277
1351
|
accept_json: true
|
1278
1352
|
)
|
1279
|
-
|
1353
|
+
nil
|
1280
1354
|
end
|
1355
|
+
#########################
|
1356
|
+
# Mentions
|
1357
|
+
#########################
|
1281
1358
|
|
1282
1359
|
##
|
1283
|
-
# @!method
|
1284
|
-
#
|
1285
|
-
#
|
1286
|
-
#
|
1360
|
+
# @!method list_mentions(workspace_id:, entity:, export: nil, include_audit: nil)
|
1361
|
+
# List entity mentions.
|
1362
|
+
# List mentions for a contextual entity. An entity mention is an occurrence of a
|
1363
|
+
# contextual entity in the context of an intent user input example.
|
1287
1364
|
#
|
1288
|
-
# This operation is limited to
|
1365
|
+
# This operation is limited to 200 requests per 30 minutes. For more information,
|
1289
1366
|
# see **Rate limiting**.
|
1290
1367
|
# @param workspace_id [String] Unique identifier of the workspace.
|
1291
1368
|
# @param entity [String] The name of the entity.
|
1292
|
-
# @param
|
1293
|
-
#
|
1294
|
-
#
|
1295
|
-
#
|
1296
|
-
#
|
1297
|
-
# newline, or tab characters, and it must be no longer than 128 characters.
|
1298
|
-
# @param new_metadata [Hash] Any metadata related to the entity.
|
1299
|
-
# @param new_fuzzy_match [Boolean] Whether to use fuzzy matching for the entity.
|
1300
|
-
# @param new_values [Array[CreateValue]] An array of objects describing the entity values.
|
1369
|
+
# @param export [Boolean] Whether to include all element content in the returned data. If
|
1370
|
+
# **export**=`false`, the returned data includes only information about the element
|
1371
|
+
# itself. If **export**=`true`, all content, including subelements, is included.
|
1372
|
+
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
1373
|
+
# the response.
|
1301
1374
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1302
|
-
def
|
1375
|
+
def list_mentions(workspace_id:, entity:, export: nil, include_audit: nil)
|
1303
1376
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1304
1377
|
|
1305
1378
|
raise ArgumentError.new("entity must be provided") if entity.nil?
|
1306
1379
|
|
1307
1380
|
headers = {
|
1308
1381
|
}
|
1309
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
1382
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_mentions")
|
1310
1383
|
headers.merge!(sdk_headers)
|
1311
1384
|
|
1312
1385
|
params = {
|
1313
|
-
"version" => @version
|
1314
|
-
|
1315
|
-
|
1316
|
-
data = {
|
1317
|
-
"entity" => new_entity,
|
1318
|
-
"description" => new_description,
|
1319
|
-
"metadata" => new_metadata,
|
1320
|
-
"fuzzy_match" => new_fuzzy_match,
|
1321
|
-
"values" => new_values
|
1386
|
+
"version" => @version,
|
1387
|
+
"export" => export,
|
1388
|
+
"include_audit" => include_audit
|
1322
1389
|
}
|
1323
1390
|
|
1324
|
-
method_url = "/v1/workspaces/%s/entities/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
|
1391
|
+
method_url = "/v1/workspaces/%s/entities/%s/mentions" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
|
1325
1392
|
|
1326
1393
|
response = request(
|
1327
|
-
method: "
|
1394
|
+
method: "GET",
|
1328
1395
|
url: method_url,
|
1329
1396
|
headers: headers,
|
1330
1397
|
params: params,
|
1331
|
-
json: data,
|
1332
1398
|
accept_json: true
|
1333
1399
|
)
|
1334
1400
|
response
|
1335
1401
|
end
|
1336
1402
|
#########################
|
1337
|
-
#
|
1403
|
+
# Values
|
1338
1404
|
#########################
|
1339
1405
|
|
1340
1406
|
##
|
1341
|
-
# @!method
|
1342
|
-
# List entity
|
1343
|
-
# List
|
1344
|
-
# contextual entity in the context of an intent user input example.
|
1407
|
+
# @!method list_values(workspace_id:, entity:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
1408
|
+
# List entity values.
|
1409
|
+
# List the values for an entity.
|
1345
1410
|
#
|
1346
|
-
# This operation is limited to
|
1411
|
+
# This operation is limited to 2500 requests per 30 minutes. For more information,
|
1347
1412
|
# see **Rate limiting**.
|
1348
1413
|
# @param workspace_id [String] Unique identifier of the workspace.
|
1349
1414
|
# @param entity [String] The name of the entity.
|
1350
1415
|
# @param export [Boolean] Whether to include all element content in the returned data. If
|
1351
1416
|
# **export**=`false`, the returned data includes only information about the element
|
1352
1417
|
# itself. If **export**=`true`, all content, including subelements, is included.
|
1418
|
+
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
1419
|
+
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
1420
|
+
# @param sort [String] The attribute by which returned entity values will be sorted. To reverse the sort
|
1421
|
+
# order, prefix the value with a minus sign (`-`).
|
1422
|
+
# @param cursor [String] A token identifying the page of results to retrieve.
|
1353
1423
|
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
1354
1424
|
# the response.
|
1355
1425
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1356
|
-
def
|
1426
|
+
def list_values(workspace_id:, entity:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
1357
1427
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1358
1428
|
|
1359
1429
|
raise ArgumentError.new("entity must be provided") if entity.nil?
|
1360
1430
|
|
1361
1431
|
headers = {
|
1362
1432
|
}
|
1363
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
1433
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_values")
|
1364
1434
|
headers.merge!(sdk_headers)
|
1365
1435
|
|
1366
1436
|
params = {
|
1367
1437
|
"version" => @version,
|
1368
1438
|
"export" => export,
|
1439
|
+
"page_limit" => page_limit,
|
1440
|
+
"include_count" => include_count,
|
1441
|
+
"sort" => sort,
|
1442
|
+
"cursor" => cursor,
|
1369
1443
|
"include_audit" => include_audit
|
1370
1444
|
}
|
1371
1445
|
|
1372
|
-
method_url = "/v1/workspaces/%s/entities/%s/
|
1446
|
+
method_url = "/v1/workspaces/%s/entities/%s/values" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
|
1373
1447
|
|
1374
1448
|
response = request(
|
1375
1449
|
method: "GET",
|
@@ -1380,15 +1454,15 @@ module IBMWatson
|
|
1380
1454
|
)
|
1381
1455
|
response
|
1382
1456
|
end
|
1383
|
-
#########################
|
1384
|
-
# Values
|
1385
|
-
#########################
|
1386
1457
|
|
1387
1458
|
##
|
1388
1459
|
# @!method create_value(workspace_id:, entity:, value:, metadata: nil, value_type: nil, synonyms: nil, patterns: nil)
|
1389
1460
|
# Create entity value.
|
1390
1461
|
# Create a new value for an entity.
|
1391
1462
|
#
|
1463
|
+
# If you want to create multiple entity values with a single API call, consider
|
1464
|
+
# using the **[Update entity](#update-entity)** method instead.
|
1465
|
+
#
|
1392
1466
|
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
1393
1467
|
# see **Rate limiting**.
|
1394
1468
|
# @param workspace_id [String] Unique identifier of the workspace.
|
@@ -1397,7 +1471,6 @@ module IBMWatson
|
|
1397
1471
|
# restrictions:
|
1398
1472
|
# - It cannot contain carriage return, newline, or tab characters.
|
1399
1473
|
# - It cannot consist of only whitespace characters.
|
1400
|
-
# - It must be no longer than 64 characters.
|
1401
1474
|
# @param metadata [Hash] Any metadata related to the entity value.
|
1402
1475
|
# @param value_type [String] Specifies the type of entity value.
|
1403
1476
|
# @param synonyms [Array[String]] An array of synonyms for the entity value. A value can specify either synonyms or
|
@@ -1405,12 +1478,10 @@ module IBMWatson
|
|
1405
1478
|
# the following resrictions:
|
1406
1479
|
# - It cannot contain carriage return, newline, or tab characters.
|
1407
1480
|
# - It cannot consist of only whitespace characters.
|
1408
|
-
# - It must be no longer than 64 characters.
|
1409
1481
|
# @param patterns [Array[String]] An array of patterns for the entity value. A value can specify either synonyms or
|
1410
1482
|
# patterns (depending on the value type), but not both. A pattern is a regular
|
1411
|
-
# expression
|
1412
|
-
#
|
1413
|
-
# [documentation](https://cloud.ibm.com/docs/services/assistant/entities.html#entities-create-dictionary-based).
|
1483
|
+
# expression; for more information about how to specify a pattern, see the
|
1484
|
+
# [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-entities#entities-create-dictionary-based).
|
1414
1485
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1415
1486
|
def create_value(workspace_id:, entity:, value:, metadata: nil, value_type: nil, synonyms: nil, patterns: nil)
|
1416
1487
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
@@ -1449,45 +1520,6 @@ module IBMWatson
|
|
1449
1520
|
response
|
1450
1521
|
end
|
1451
1522
|
|
1452
|
-
##
|
1453
|
-
# @!method delete_value(workspace_id:, entity:, value:)
|
1454
|
-
# Delete entity value.
|
1455
|
-
# Delete a value from an entity.
|
1456
|
-
#
|
1457
|
-
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
1458
|
-
# see **Rate limiting**.
|
1459
|
-
# @param workspace_id [String] Unique identifier of the workspace.
|
1460
|
-
# @param entity [String] The name of the entity.
|
1461
|
-
# @param value [String] The text of the entity value.
|
1462
|
-
# @return [nil]
|
1463
|
-
def delete_value(workspace_id:, entity:, value:)
|
1464
|
-
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1465
|
-
|
1466
|
-
raise ArgumentError.new("entity must be provided") if entity.nil?
|
1467
|
-
|
1468
|
-
raise ArgumentError.new("value must be provided") if value.nil?
|
1469
|
-
|
1470
|
-
headers = {
|
1471
|
-
}
|
1472
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_value")
|
1473
|
-
headers.merge!(sdk_headers)
|
1474
|
-
|
1475
|
-
params = {
|
1476
|
-
"version" => @version
|
1477
|
-
}
|
1478
|
-
|
1479
|
-
method_url = "/v1/workspaces/%s/entities/%s/values/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
|
1480
|
-
|
1481
|
-
request(
|
1482
|
-
method: "DELETE",
|
1483
|
-
url: method_url,
|
1484
|
-
headers: headers,
|
1485
|
-
params: params,
|
1486
|
-
accept_json: true
|
1487
|
-
)
|
1488
|
-
nil
|
1489
|
-
end
|
1490
|
-
|
1491
1523
|
##
|
1492
1524
|
# @!method get_value(workspace_id:, entity:, value:, export: nil, include_audit: nil)
|
1493
1525
|
# Get entity value.
|
@@ -1534,64 +1566,15 @@ module IBMWatson
|
|
1534
1566
|
response
|
1535
1567
|
end
|
1536
1568
|
|
1537
|
-
##
|
1538
|
-
# @!method list_values(workspace_id:, entity:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
1539
|
-
# List entity values.
|
1540
|
-
# List the values for an entity.
|
1541
|
-
#
|
1542
|
-
# This operation is limited to 2500 requests per 30 minutes. For more information,
|
1543
|
-
# see **Rate limiting**.
|
1544
|
-
# @param workspace_id [String] Unique identifier of the workspace.
|
1545
|
-
# @param entity [String] The name of the entity.
|
1546
|
-
# @param export [Boolean] Whether to include all element content in the returned data. If
|
1547
|
-
# **export**=`false`, the returned data includes only information about the element
|
1548
|
-
# itself. If **export**=`true`, all content, including subelements, is included.
|
1549
|
-
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
1550
|
-
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
1551
|
-
# @param sort [String] The attribute by which returned entity values will be sorted. To reverse the sort
|
1552
|
-
# order, prefix the value with a minus sign (`-`).
|
1553
|
-
# @param cursor [String] A token identifying the page of results to retrieve.
|
1554
|
-
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
1555
|
-
# the response.
|
1556
|
-
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1557
|
-
def list_values(workspace_id:, entity:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
1558
|
-
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1559
|
-
|
1560
|
-
raise ArgumentError.new("entity must be provided") if entity.nil?
|
1561
|
-
|
1562
|
-
headers = {
|
1563
|
-
}
|
1564
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_values")
|
1565
|
-
headers.merge!(sdk_headers)
|
1566
|
-
|
1567
|
-
params = {
|
1568
|
-
"version" => @version,
|
1569
|
-
"export" => export,
|
1570
|
-
"page_limit" => page_limit,
|
1571
|
-
"include_count" => include_count,
|
1572
|
-
"sort" => sort,
|
1573
|
-
"cursor" => cursor,
|
1574
|
-
"include_audit" => include_audit
|
1575
|
-
}
|
1576
|
-
|
1577
|
-
method_url = "/v1/workspaces/%s/entities/%s/values" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
|
1578
|
-
|
1579
|
-
response = request(
|
1580
|
-
method: "GET",
|
1581
|
-
url: method_url,
|
1582
|
-
headers: headers,
|
1583
|
-
params: params,
|
1584
|
-
accept_json: true
|
1585
|
-
)
|
1586
|
-
response
|
1587
|
-
end
|
1588
|
-
|
1589
1569
|
##
|
1590
1570
|
# @!method update_value(workspace_id:, entity:, value:, new_value: nil, new_metadata: nil, new_value_type: nil, new_synonyms: nil, new_patterns: nil)
|
1591
1571
|
# Update entity value.
|
1592
1572
|
# Update an existing entity value with new or modified data. You must provide
|
1593
1573
|
# component objects defining the content of the updated entity value.
|
1594
1574
|
#
|
1575
|
+
# If you want to update multiple entity values with a single API call, consider
|
1576
|
+
# using the **[Update entity](#update-entity)** method instead.
|
1577
|
+
#
|
1595
1578
|
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
1596
1579
|
# see **Rate limiting**.
|
1597
1580
|
# @param workspace_id [String] Unique identifier of the workspace.
|
@@ -1601,7 +1584,6 @@ module IBMWatson
|
|
1601
1584
|
# restrictions:
|
1602
1585
|
# - It cannot contain carriage return, newline, or tab characters.
|
1603
1586
|
# - It cannot consist of only whitespace characters.
|
1604
|
-
# - It must be no longer than 64 characters.
|
1605
1587
|
# @param new_metadata [Hash] Any metadata related to the entity value.
|
1606
1588
|
# @param new_value_type [String] Specifies the type of entity value.
|
1607
1589
|
# @param new_synonyms [Array[String]] An array of synonyms for the entity value. A value can specify either synonyms or
|
@@ -1609,12 +1591,10 @@ module IBMWatson
|
|
1609
1591
|
# the following resrictions:
|
1610
1592
|
# - It cannot contain carriage return, newline, or tab characters.
|
1611
1593
|
# - It cannot consist of only whitespace characters.
|
1612
|
-
# - It must be no longer than 64 characters.
|
1613
1594
|
# @param new_patterns [Array[String]] An array of patterns for the entity value. A value can specify either synonyms or
|
1614
1595
|
# patterns (depending on the value type), but not both. A pattern is a regular
|
1615
|
-
# expression
|
1616
|
-
#
|
1617
|
-
# [documentation](https://cloud.ibm.com/docs/services/assistant/entities.html#entities-create-dictionary-based).
|
1596
|
+
# expression; for more information about how to specify a pattern, see the
|
1597
|
+
# [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-entities#entities-create-dictionary-based).
|
1618
1598
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1619
1599
|
def update_value(workspace_id:, entity:, value:, new_value: nil, new_metadata: nil, new_value_type: nil, new_synonyms: nil, new_patterns: nil)
|
1620
1600
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
@@ -1652,117 +1632,119 @@ module IBMWatson
|
|
1652
1632
|
)
|
1653
1633
|
response
|
1654
1634
|
end
|
1655
|
-
#########################
|
1656
|
-
# Synonyms
|
1657
|
-
#########################
|
1658
1635
|
|
1659
1636
|
##
|
1660
|
-
# @!method
|
1661
|
-
#
|
1662
|
-
#
|
1637
|
+
# @!method delete_value(workspace_id:, entity:, value:)
|
1638
|
+
# Delete entity value.
|
1639
|
+
# Delete a value from an entity.
|
1663
1640
|
#
|
1664
1641
|
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
1665
1642
|
# see **Rate limiting**.
|
1666
1643
|
# @param workspace_id [String] Unique identifier of the workspace.
|
1667
1644
|
# @param entity [String] The name of the entity.
|
1668
1645
|
# @param value [String] The text of the entity value.
|
1669
|
-
# @
|
1670
|
-
|
1671
|
-
# - It cannot consist of only whitespace characters.
|
1672
|
-
# - It must be no longer than 64 characters.
|
1673
|
-
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1674
|
-
def create_synonym(workspace_id:, entity:, value:, synonym:)
|
1646
|
+
# @return [nil]
|
1647
|
+
def delete_value(workspace_id:, entity:, value:)
|
1675
1648
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1676
1649
|
|
1677
1650
|
raise ArgumentError.new("entity must be provided") if entity.nil?
|
1678
1651
|
|
1679
1652
|
raise ArgumentError.new("value must be provided") if value.nil?
|
1680
1653
|
|
1681
|
-
raise ArgumentError.new("synonym must be provided") if synonym.nil?
|
1682
|
-
|
1683
1654
|
headers = {
|
1684
1655
|
}
|
1685
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
1656
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_value")
|
1686
1657
|
headers.merge!(sdk_headers)
|
1687
1658
|
|
1688
1659
|
params = {
|
1689
1660
|
"version" => @version
|
1690
1661
|
}
|
1691
1662
|
|
1692
|
-
|
1693
|
-
"synonym" => synonym
|
1694
|
-
}
|
1695
|
-
|
1696
|
-
method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
|
1663
|
+
method_url = "/v1/workspaces/%s/entities/%s/values/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
|
1697
1664
|
|
1698
|
-
|
1699
|
-
method: "
|
1665
|
+
request(
|
1666
|
+
method: "DELETE",
|
1700
1667
|
url: method_url,
|
1701
1668
|
headers: headers,
|
1702
1669
|
params: params,
|
1703
|
-
json: data,
|
1704
1670
|
accept_json: true
|
1705
1671
|
)
|
1706
|
-
|
1672
|
+
nil
|
1707
1673
|
end
|
1674
|
+
#########################
|
1675
|
+
# Synonyms
|
1676
|
+
#########################
|
1708
1677
|
|
1709
1678
|
##
|
1710
|
-
# @!method
|
1711
|
-
#
|
1712
|
-
#
|
1679
|
+
# @!method list_synonyms(workspace_id:, entity:, value:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
1680
|
+
# List entity value synonyms.
|
1681
|
+
# List the synonyms for an entity value.
|
1713
1682
|
#
|
1714
|
-
# This operation is limited to
|
1683
|
+
# This operation is limited to 2500 requests per 30 minutes. For more information,
|
1715
1684
|
# see **Rate limiting**.
|
1716
1685
|
# @param workspace_id [String] Unique identifier of the workspace.
|
1717
1686
|
# @param entity [String] The name of the entity.
|
1718
1687
|
# @param value [String] The text of the entity value.
|
1719
|
-
# @param
|
1720
|
-
# @
|
1721
|
-
|
1688
|
+
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
1689
|
+
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
1690
|
+
# @param sort [String] The attribute by which returned entity value synonyms will be sorted. To reverse
|
1691
|
+
# the sort order, prefix the value with a minus sign (`-`).
|
1692
|
+
# @param cursor [String] A token identifying the page of results to retrieve.
|
1693
|
+
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
1694
|
+
# the response.
|
1695
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1696
|
+
def list_synonyms(workspace_id:, entity:, value:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
1722
1697
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1723
1698
|
|
1724
1699
|
raise ArgumentError.new("entity must be provided") if entity.nil?
|
1725
1700
|
|
1726
1701
|
raise ArgumentError.new("value must be provided") if value.nil?
|
1727
1702
|
|
1728
|
-
raise ArgumentError.new("synonym must be provided") if synonym.nil?
|
1729
|
-
|
1730
1703
|
headers = {
|
1731
1704
|
}
|
1732
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
1705
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_synonyms")
|
1733
1706
|
headers.merge!(sdk_headers)
|
1734
1707
|
|
1735
1708
|
params = {
|
1736
|
-
"version" => @version
|
1709
|
+
"version" => @version,
|
1710
|
+
"page_limit" => page_limit,
|
1711
|
+
"include_count" => include_count,
|
1712
|
+
"sort" => sort,
|
1713
|
+
"cursor" => cursor,
|
1714
|
+
"include_audit" => include_audit
|
1737
1715
|
}
|
1738
1716
|
|
1739
|
-
method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms
|
1717
|
+
method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
|
1740
1718
|
|
1741
|
-
request(
|
1742
|
-
method: "
|
1719
|
+
response = request(
|
1720
|
+
method: "GET",
|
1743
1721
|
url: method_url,
|
1744
1722
|
headers: headers,
|
1745
1723
|
params: params,
|
1746
1724
|
accept_json: true
|
1747
1725
|
)
|
1748
|
-
|
1726
|
+
response
|
1749
1727
|
end
|
1750
1728
|
|
1751
1729
|
##
|
1752
|
-
# @!method
|
1753
|
-
#
|
1754
|
-
#
|
1730
|
+
# @!method create_synonym(workspace_id:, entity:, value:, synonym:)
|
1731
|
+
# Create entity value synonym.
|
1732
|
+
# Add a new synonym to an entity value.
|
1755
1733
|
#
|
1756
|
-
#
|
1734
|
+
# If you want to create multiple synonyms with a single API call, consider using the
|
1735
|
+
# **[Update entity](#update-entity)** or **[Update entity
|
1736
|
+
# value](#update-entity-value)** method instead.
|
1737
|
+
#
|
1738
|
+
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
1757
1739
|
# see **Rate limiting**.
|
1758
1740
|
# @param workspace_id [String] Unique identifier of the workspace.
|
1759
1741
|
# @param entity [String] The name of the entity.
|
1760
1742
|
# @param value [String] The text of the entity value.
|
1761
|
-
# @param synonym [String] The text of the synonym.
|
1762
|
-
#
|
1763
|
-
#
|
1743
|
+
# @param synonym [String] The text of the synonym. This string must conform to the following restrictions:
|
1744
|
+
# - It cannot contain carriage return, newline, or tab characters.
|
1745
|
+
# - It cannot consist of only whitespace characters.
|
1764
1746
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1765
|
-
def
|
1747
|
+
def create_synonym(workspace_id:, entity:, value:, synonym:)
|
1766
1748
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1767
1749
|
|
1768
1750
|
raise ArgumentError.new("entity must be provided") if entity.nil?
|
@@ -1773,66 +1755,64 @@ module IBMWatson
|
|
1773
1755
|
|
1774
1756
|
headers = {
|
1775
1757
|
}
|
1776
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
1758
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "create_synonym")
|
1777
1759
|
headers.merge!(sdk_headers)
|
1778
1760
|
|
1779
1761
|
params = {
|
1780
|
-
"version" => @version
|
1781
|
-
"include_audit" => include_audit
|
1762
|
+
"version" => @version
|
1782
1763
|
}
|
1783
1764
|
|
1784
|
-
|
1765
|
+
data = {
|
1766
|
+
"synonym" => synonym
|
1767
|
+
}
|
1768
|
+
|
1769
|
+
method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
|
1785
1770
|
|
1786
1771
|
response = request(
|
1787
|
-
method: "
|
1772
|
+
method: "POST",
|
1788
1773
|
url: method_url,
|
1789
1774
|
headers: headers,
|
1790
1775
|
params: params,
|
1776
|
+
json: data,
|
1791
1777
|
accept_json: true
|
1792
1778
|
)
|
1793
1779
|
response
|
1794
1780
|
end
|
1795
1781
|
|
1796
1782
|
##
|
1797
|
-
# @!method
|
1798
|
-
#
|
1799
|
-
#
|
1783
|
+
# @!method get_synonym(workspace_id:, entity:, value:, synonym:, include_audit: nil)
|
1784
|
+
# Get entity value synonym.
|
1785
|
+
# Get information about a synonym of an entity value.
|
1800
1786
|
#
|
1801
|
-
# This operation is limited to
|
1787
|
+
# This operation is limited to 6000 requests per 5 minutes. For more information,
|
1802
1788
|
# see **Rate limiting**.
|
1803
1789
|
# @param workspace_id [String] Unique identifier of the workspace.
|
1804
1790
|
# @param entity [String] The name of the entity.
|
1805
1791
|
# @param value [String] The text of the entity value.
|
1806
|
-
# @param
|
1807
|
-
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
1808
|
-
# @param sort [String] The attribute by which returned entity value synonyms will be sorted. To reverse
|
1809
|
-
# the sort order, prefix the value with a minus sign (`-`).
|
1810
|
-
# @param cursor [String] A token identifying the page of results to retrieve.
|
1792
|
+
# @param synonym [String] The text of the synonym.
|
1811
1793
|
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
1812
1794
|
# the response.
|
1813
1795
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1814
|
-
def
|
1796
|
+
def get_synonym(workspace_id:, entity:, value:, synonym:, include_audit: nil)
|
1815
1797
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1816
1798
|
|
1817
1799
|
raise ArgumentError.new("entity must be provided") if entity.nil?
|
1818
1800
|
|
1819
1801
|
raise ArgumentError.new("value must be provided") if value.nil?
|
1820
1802
|
|
1803
|
+
raise ArgumentError.new("synonym must be provided") if synonym.nil?
|
1804
|
+
|
1821
1805
|
headers = {
|
1822
1806
|
}
|
1823
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
1807
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "get_synonym")
|
1824
1808
|
headers.merge!(sdk_headers)
|
1825
1809
|
|
1826
1810
|
params = {
|
1827
1811
|
"version" => @version,
|
1828
|
-
"page_limit" => page_limit,
|
1829
|
-
"include_count" => include_count,
|
1830
|
-
"sort" => sort,
|
1831
|
-
"cursor" => cursor,
|
1832
1812
|
"include_audit" => include_audit
|
1833
1813
|
}
|
1834
1814
|
|
1835
|
-
method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
|
1815
|
+
method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value), ERB::Util.url_encode(synonym)]
|
1836
1816
|
|
1837
1817
|
response = request(
|
1838
1818
|
method: "GET",
|
@@ -1849,6 +1829,10 @@ module IBMWatson
|
|
1849
1829
|
# Update entity value synonym.
|
1850
1830
|
# Update an existing entity value synonym with new text.
|
1851
1831
|
#
|
1832
|
+
# If you want to update multiple synonyms with a single API call, consider using the
|
1833
|
+
# **[Update entity](#update-entity)** or **[Update entity
|
1834
|
+
# value](#update-entity-value)** method instead.
|
1835
|
+
#
|
1852
1836
|
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
1853
1837
|
# see **Rate limiting**.
|
1854
1838
|
# @param workspace_id [String] Unique identifier of the workspace.
|
@@ -1858,7 +1842,6 @@ module IBMWatson
|
|
1858
1842
|
# @param new_synonym [String] The text of the synonym. This string must conform to the following restrictions:
|
1859
1843
|
# - It cannot contain carriage return, newline, or tab characters.
|
1860
1844
|
# - It cannot consist of only whitespace characters.
|
1861
|
-
# - It must be no longer than 64 characters.
|
1862
1845
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1863
1846
|
def update_synonym(workspace_id:, entity:, value:, synonym:, new_synonym: nil)
|
1864
1847
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
@@ -1894,34 +1877,122 @@ module IBMWatson
|
|
1894
1877
|
)
|
1895
1878
|
response
|
1896
1879
|
end
|
1880
|
+
|
1881
|
+
##
|
1882
|
+
# @!method delete_synonym(workspace_id:, entity:, value:, synonym:)
|
1883
|
+
# Delete entity value synonym.
|
1884
|
+
# Delete a synonym from an entity value.
|
1885
|
+
#
|
1886
|
+
# This operation is limited to 1000 requests per 30 minutes. For more information,
|
1887
|
+
# see **Rate limiting**.
|
1888
|
+
# @param workspace_id [String] Unique identifier of the workspace.
|
1889
|
+
# @param entity [String] The name of the entity.
|
1890
|
+
# @param value [String] The text of the entity value.
|
1891
|
+
# @param synonym [String] The text of the synonym.
|
1892
|
+
# @return [nil]
|
1893
|
+
def delete_synonym(workspace_id:, entity:, value:, synonym:)
|
1894
|
+
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1895
|
+
|
1896
|
+
raise ArgumentError.new("entity must be provided") if entity.nil?
|
1897
|
+
|
1898
|
+
raise ArgumentError.new("value must be provided") if value.nil?
|
1899
|
+
|
1900
|
+
raise ArgumentError.new("synonym must be provided") if synonym.nil?
|
1901
|
+
|
1902
|
+
headers = {
|
1903
|
+
}
|
1904
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_synonym")
|
1905
|
+
headers.merge!(sdk_headers)
|
1906
|
+
|
1907
|
+
params = {
|
1908
|
+
"version" => @version
|
1909
|
+
}
|
1910
|
+
|
1911
|
+
method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value), ERB::Util.url_encode(synonym)]
|
1912
|
+
|
1913
|
+
request(
|
1914
|
+
method: "DELETE",
|
1915
|
+
url: method_url,
|
1916
|
+
headers: headers,
|
1917
|
+
params: params,
|
1918
|
+
accept_json: true
|
1919
|
+
)
|
1920
|
+
nil
|
1921
|
+
end
|
1897
1922
|
#########################
|
1898
1923
|
# Dialog nodes
|
1899
1924
|
#########################
|
1900
1925
|
|
1926
|
+
##
|
1927
|
+
# @!method list_dialog_nodes(workspace_id:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
1928
|
+
# List dialog nodes.
|
1929
|
+
# List the dialog nodes for a workspace.
|
1930
|
+
#
|
1931
|
+
# This operation is limited to 2500 requests per 30 minutes. For more information,
|
1932
|
+
# see **Rate limiting**.
|
1933
|
+
# @param workspace_id [String] Unique identifier of the workspace.
|
1934
|
+
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
1935
|
+
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
1936
|
+
# @param sort [String] The attribute by which returned dialog nodes will be sorted. To reverse the sort
|
1937
|
+
# order, prefix the value with a minus sign (`-`).
|
1938
|
+
# @param cursor [String] A token identifying the page of results to retrieve.
|
1939
|
+
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
1940
|
+
# the response.
|
1941
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1942
|
+
def list_dialog_nodes(workspace_id:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
1943
|
+
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
1944
|
+
|
1945
|
+
headers = {
|
1946
|
+
}
|
1947
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_dialog_nodes")
|
1948
|
+
headers.merge!(sdk_headers)
|
1949
|
+
|
1950
|
+
params = {
|
1951
|
+
"version" => @version,
|
1952
|
+
"page_limit" => page_limit,
|
1953
|
+
"include_count" => include_count,
|
1954
|
+
"sort" => sort,
|
1955
|
+
"cursor" => cursor,
|
1956
|
+
"include_audit" => include_audit
|
1957
|
+
}
|
1958
|
+
|
1959
|
+
method_url = "/v1/workspaces/%s/dialog_nodes" % [ERB::Util.url_encode(workspace_id)]
|
1960
|
+
|
1961
|
+
response = request(
|
1962
|
+
method: "GET",
|
1963
|
+
url: method_url,
|
1964
|
+
headers: headers,
|
1965
|
+
params: params,
|
1966
|
+
accept_json: true
|
1967
|
+
)
|
1968
|
+
response
|
1969
|
+
end
|
1970
|
+
|
1901
1971
|
##
|
1902
1972
|
# @!method create_dialog_node(workspace_id:, dialog_node:, description: nil, conditions: nil, parent: nil, previous_sibling: nil, output: nil, context: nil, metadata: nil, next_step: nil, title: nil, node_type: nil, event_name: nil, variable: nil, actions: nil, digress_in: nil, digress_out: nil, digress_out_slots: nil, user_label: nil)
|
1903
1973
|
# Create dialog node.
|
1904
1974
|
# Create a new dialog node.
|
1905
1975
|
#
|
1976
|
+
# If you want to create multiple dialog nodes with a single API call, consider using
|
1977
|
+
# the **[Update workspace](#update-workspace)** method instead.
|
1978
|
+
#
|
1906
1979
|
# This operation is limited to 500 requests per 30 minutes. For more information,
|
1907
1980
|
# see **Rate limiting**.
|
1908
1981
|
# @param workspace_id [String] Unique identifier of the workspace.
|
1909
1982
|
# @param dialog_node [String] The dialog node ID. This string must conform to the following restrictions:
|
1910
1983
|
# - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
|
1911
1984
|
# characters.
|
1912
|
-
# - It must be no longer than 1024 characters.
|
1913
1985
|
# @param description [String] The description of the dialog node. This string cannot contain carriage return,
|
1914
|
-
# newline, or tab characters
|
1986
|
+
# newline, or tab characters.
|
1915
1987
|
# @param conditions [String] The condition that will trigger the dialog node. This string cannot contain
|
1916
|
-
# carriage return, newline, or tab characters
|
1917
|
-
# characters.
|
1988
|
+
# carriage return, newline, or tab characters.
|
1918
1989
|
# @param parent [String] The ID of the parent dialog node. This property is omitted if the dialog node has
|
1919
1990
|
# no parent.
|
1920
1991
|
# @param previous_sibling [String] The ID of the previous sibling dialog node. This property is omitted if the dialog
|
1921
1992
|
# node has no previous sibling.
|
1922
1993
|
# @param output [DialogNodeOutput] The output of the dialog node. For more information about how to specify dialog
|
1923
1994
|
# node output, see the
|
1924
|
-
# [documentation](https://cloud.ibm.com/docs/services/assistant
|
1995
|
+
# [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
|
1925
1996
|
# @param context [Hash] The context for the dialog node.
|
1926
1997
|
# @param metadata [Hash] The metadata for the dialog node.
|
1927
1998
|
# @param next_step [DialogNodeNextStep] The next step to execute following this dialog node.
|
@@ -1929,7 +2000,6 @@ module IBMWatson
|
|
1929
2000
|
# following restrictions:
|
1930
2001
|
# - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
|
1931
2002
|
# characters.
|
1932
|
-
# - It must be no longer than 64 characters.
|
1933
2003
|
# @param node_type [String] How the dialog node is processed.
|
1934
2004
|
# @param event_name [String] How an `event_handler` node is processed.
|
1935
2005
|
# @param variable [String] The location in the dialog context where output is stored.
|
@@ -1938,7 +2008,7 @@ module IBMWatson
|
|
1938
2008
|
# @param digress_out [String] Whether this dialog node can be returned to after a digression.
|
1939
2009
|
# @param digress_out_slots [String] Whether the user can digress to top-level nodes while filling out slots.
|
1940
2010
|
# @param user_label [String] A label that can be displayed externally to describe the purpose of the node to
|
1941
|
-
# users.
|
2011
|
+
# users.
|
1942
2012
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1943
2013
|
def create_dialog_node(workspace_id:, dialog_node:, description: nil, conditions: nil, parent: nil, previous_sibling: nil, output: nil, context: nil, metadata: nil, next_step: nil, title: nil, node_type: nil, event_name: nil, variable: nil, actions: nil, digress_in: nil, digress_out: nil, digress_out_slots: nil, user_label: nil)
|
1944
2014
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
@@ -1988,42 +2058,6 @@ module IBMWatson
|
|
1988
2058
|
response
|
1989
2059
|
end
|
1990
2060
|
|
1991
|
-
##
|
1992
|
-
# @!method delete_dialog_node(workspace_id:, dialog_node:)
|
1993
|
-
# Delete dialog node.
|
1994
|
-
# Delete a dialog node from a workspace.
|
1995
|
-
#
|
1996
|
-
# This operation is limited to 500 requests per 30 minutes. For more information,
|
1997
|
-
# see **Rate limiting**.
|
1998
|
-
# @param workspace_id [String] Unique identifier of the workspace.
|
1999
|
-
# @param dialog_node [String] The dialog node ID (for example, `get_order`).
|
2000
|
-
# @return [nil]
|
2001
|
-
def delete_dialog_node(workspace_id:, dialog_node:)
|
2002
|
-
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
2003
|
-
|
2004
|
-
raise ArgumentError.new("dialog_node must be provided") if dialog_node.nil?
|
2005
|
-
|
2006
|
-
headers = {
|
2007
|
-
}
|
2008
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_dialog_node")
|
2009
|
-
headers.merge!(sdk_headers)
|
2010
|
-
|
2011
|
-
params = {
|
2012
|
-
"version" => @version
|
2013
|
-
}
|
2014
|
-
|
2015
|
-
method_url = "/v1/workspaces/%s/dialog_nodes/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(dialog_node)]
|
2016
|
-
|
2017
|
-
request(
|
2018
|
-
method: "DELETE",
|
2019
|
-
url: method_url,
|
2020
|
-
headers: headers,
|
2021
|
-
params: params,
|
2022
|
-
accept_json: true
|
2023
|
-
)
|
2024
|
-
nil
|
2025
|
-
end
|
2026
|
-
|
2027
2061
|
##
|
2028
2062
|
# @!method get_dialog_node(workspace_id:, dialog_node:, include_audit: nil)
|
2029
2063
|
# Get dialog node.
|
@@ -2063,56 +2097,14 @@ module IBMWatson
|
|
2063
2097
|
response
|
2064
2098
|
end
|
2065
2099
|
|
2066
|
-
##
|
2067
|
-
# @!method list_dialog_nodes(workspace_id:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
2068
|
-
# List dialog nodes.
|
2069
|
-
# List the dialog nodes for a workspace.
|
2070
|
-
#
|
2071
|
-
# This operation is limited to 2500 requests per 30 minutes. For more information,
|
2072
|
-
# see **Rate limiting**.
|
2073
|
-
# @param workspace_id [String] Unique identifier of the workspace.
|
2074
|
-
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
2075
|
-
# @param include_count [Boolean] Whether to include information about the number of records returned.
|
2076
|
-
# @param sort [String] The attribute by which returned dialog nodes will be sorted. To reverse the sort
|
2077
|
-
# order, prefix the value with a minus sign (`-`).
|
2078
|
-
# @param cursor [String] A token identifying the page of results to retrieve.
|
2079
|
-
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
|
2080
|
-
# the response.
|
2081
|
-
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
2082
|
-
def list_dialog_nodes(workspace_id:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
|
2083
|
-
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
2084
|
-
|
2085
|
-
headers = {
|
2086
|
-
}
|
2087
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_dialog_nodes")
|
2088
|
-
headers.merge!(sdk_headers)
|
2089
|
-
|
2090
|
-
params = {
|
2091
|
-
"version" => @version,
|
2092
|
-
"page_limit" => page_limit,
|
2093
|
-
"include_count" => include_count,
|
2094
|
-
"sort" => sort,
|
2095
|
-
"cursor" => cursor,
|
2096
|
-
"include_audit" => include_audit
|
2097
|
-
}
|
2098
|
-
|
2099
|
-
method_url = "/v1/workspaces/%s/dialog_nodes" % [ERB::Util.url_encode(workspace_id)]
|
2100
|
-
|
2101
|
-
response = request(
|
2102
|
-
method: "GET",
|
2103
|
-
url: method_url,
|
2104
|
-
headers: headers,
|
2105
|
-
params: params,
|
2106
|
-
accept_json: true
|
2107
|
-
)
|
2108
|
-
response
|
2109
|
-
end
|
2110
|
-
|
2111
2100
|
##
|
2112
2101
|
# @!method update_dialog_node(workspace_id:, dialog_node:, new_dialog_node: nil, new_description: nil, new_conditions: nil, new_parent: nil, new_previous_sibling: nil, new_output: nil, new_context: nil, new_metadata: nil, new_next_step: nil, new_title: nil, new_node_type: nil, new_event_name: nil, new_variable: nil, new_actions: nil, new_digress_in: nil, new_digress_out: nil, new_digress_out_slots: nil, new_user_label: nil)
|
2113
2102
|
# Update dialog node.
|
2114
2103
|
# Update an existing dialog node with new or modified data.
|
2115
2104
|
#
|
2105
|
+
# If you want to update multiple dialog nodes with a single API call, consider using
|
2106
|
+
# the **[Update workspace](#update-workspace)** method instead.
|
2107
|
+
#
|
2116
2108
|
# This operation is limited to 500 requests per 30 minutes. For more information,
|
2117
2109
|
# see **Rate limiting**.
|
2118
2110
|
# @param workspace_id [String] Unique identifier of the workspace.
|
@@ -2120,19 +2112,17 @@ module IBMWatson
|
|
2120
2112
|
# @param new_dialog_node [String] The dialog node ID. This string must conform to the following restrictions:
|
2121
2113
|
# - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
|
2122
2114
|
# characters.
|
2123
|
-
# - It must be no longer than 1024 characters.
|
2124
2115
|
# @param new_description [String] The description of the dialog node. This string cannot contain carriage return,
|
2125
|
-
# newline, or tab characters
|
2116
|
+
# newline, or tab characters.
|
2126
2117
|
# @param new_conditions [String] The condition that will trigger the dialog node. This string cannot contain
|
2127
|
-
# carriage return, newline, or tab characters
|
2128
|
-
# characters.
|
2118
|
+
# carriage return, newline, or tab characters.
|
2129
2119
|
# @param new_parent [String] The ID of the parent dialog node. This property is omitted if the dialog node has
|
2130
2120
|
# no parent.
|
2131
2121
|
# @param new_previous_sibling [String] The ID of the previous sibling dialog node. This property is omitted if the dialog
|
2132
2122
|
# node has no previous sibling.
|
2133
2123
|
# @param new_output [DialogNodeOutput] The output of the dialog node. For more information about how to specify dialog
|
2134
2124
|
# node output, see the
|
2135
|
-
# [documentation](https://cloud.ibm.com/docs/services/assistant
|
2125
|
+
# [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
|
2136
2126
|
# @param new_context [Hash] The context for the dialog node.
|
2137
2127
|
# @param new_metadata [Hash] The metadata for the dialog node.
|
2138
2128
|
# @param new_next_step [DialogNodeNextStep] The next step to execute following this dialog node.
|
@@ -2140,7 +2130,6 @@ module IBMWatson
|
|
2140
2130
|
# following restrictions:
|
2141
2131
|
# - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
|
2142
2132
|
# characters.
|
2143
|
-
# - It must be no longer than 64 characters.
|
2144
2133
|
# @param new_node_type [String] How the dialog node is processed.
|
2145
2134
|
# @param new_event_name [String] How an `event_handler` node is processed.
|
2146
2135
|
# @param new_variable [String] The location in the dialog context where output is stored.
|
@@ -2149,7 +2138,7 @@ module IBMWatson
|
|
2149
2138
|
# @param new_digress_out [String] Whether this dialog node can be returned to after a digression.
|
2150
2139
|
# @param new_digress_out_slots [String] Whether the user can digress to top-level nodes while filling out slots.
|
2151
2140
|
# @param new_user_label [String] A label that can be displayed externally to describe the purpose of the node to
|
2152
|
-
# users.
|
2141
|
+
# users.
|
2153
2142
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
2154
2143
|
def update_dialog_node(workspace_id:, dialog_node:, new_dialog_node: nil, new_description: nil, new_conditions: nil, new_parent: nil, new_previous_sibling: nil, new_output: nil, new_context: nil, new_metadata: nil, new_next_step: nil, new_title: nil, new_node_type: nil, new_event_name: nil, new_variable: nil, new_actions: nil, new_digress_in: nil, new_digress_out: nil, new_digress_out_slots: nil, new_user_label: nil)
|
2155
2144
|
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
@@ -2198,45 +2187,80 @@ module IBMWatson
|
|
2198
2187
|
)
|
2199
2188
|
response
|
2200
2189
|
end
|
2190
|
+
|
2191
|
+
##
|
2192
|
+
# @!method delete_dialog_node(workspace_id:, dialog_node:)
|
2193
|
+
# Delete dialog node.
|
2194
|
+
# Delete a dialog node from a workspace.
|
2195
|
+
#
|
2196
|
+
# This operation is limited to 500 requests per 30 minutes. For more information,
|
2197
|
+
# see **Rate limiting**.
|
2198
|
+
# @param workspace_id [String] Unique identifier of the workspace.
|
2199
|
+
# @param dialog_node [String] The dialog node ID (for example, `get_order`).
|
2200
|
+
# @return [nil]
|
2201
|
+
def delete_dialog_node(workspace_id:, dialog_node:)
|
2202
|
+
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
2203
|
+
|
2204
|
+
raise ArgumentError.new("dialog_node must be provided") if dialog_node.nil?
|
2205
|
+
|
2206
|
+
headers = {
|
2207
|
+
}
|
2208
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_dialog_node")
|
2209
|
+
headers.merge!(sdk_headers)
|
2210
|
+
|
2211
|
+
params = {
|
2212
|
+
"version" => @version
|
2213
|
+
}
|
2214
|
+
|
2215
|
+
method_url = "/v1/workspaces/%s/dialog_nodes/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(dialog_node)]
|
2216
|
+
|
2217
|
+
request(
|
2218
|
+
method: "DELETE",
|
2219
|
+
url: method_url,
|
2220
|
+
headers: headers,
|
2221
|
+
params: params,
|
2222
|
+
accept_json: true
|
2223
|
+
)
|
2224
|
+
nil
|
2225
|
+
end
|
2201
2226
|
#########################
|
2202
2227
|
# Logs
|
2203
2228
|
#########################
|
2204
2229
|
|
2205
2230
|
##
|
2206
|
-
# @!method
|
2207
|
-
# List log events in
|
2208
|
-
# List the events from the
|
2231
|
+
# @!method list_logs(workspace_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
|
2232
|
+
# List log events in a workspace.
|
2233
|
+
# List the events from the log of a specific workspace.
|
2209
2234
|
#
|
2210
2235
|
# If **cursor** is not specified, this operation is limited to 40 requests per 30
|
2211
2236
|
# minutes. If **cursor** is specified, the limit is 120 requests per minute. For
|
2212
2237
|
# more information, see **Rate limiting**.
|
2213
|
-
# @param
|
2214
|
-
# filter. You must specify a filter query that includes a value for `language`, as
|
2215
|
-
# well as a value for `workspace_id` or `request.context.metadata.deployment`. For
|
2216
|
-
# more information, see the
|
2217
|
-
# [documentation](https://cloud.ibm.com/docs/services/assistant/filter-reference.html#filter-reference-syntax).
|
2238
|
+
# @param workspace_id [String] Unique identifier of the workspace.
|
2218
2239
|
# @param sort [String] How to sort the returned log events. You can sort by **request_timestamp**. To
|
2219
2240
|
# reverse the sort order, prefix the parameter value with a minus sign (`-`).
|
2241
|
+
# @param filter [String] A cacheable parameter that limits the results to those matching the specified
|
2242
|
+
# filter. For more information, see the
|
2243
|
+
# [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-filter-reference#filter-reference).
|
2220
2244
|
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
2221
2245
|
# @param cursor [String] A token identifying the page of results to retrieve.
|
2222
2246
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
2223
|
-
def
|
2224
|
-
raise ArgumentError.new("
|
2247
|
+
def list_logs(workspace_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
|
2248
|
+
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
|
2225
2249
|
|
2226
2250
|
headers = {
|
2227
2251
|
}
|
2228
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
2252
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_logs")
|
2229
2253
|
headers.merge!(sdk_headers)
|
2230
2254
|
|
2231
2255
|
params = {
|
2232
2256
|
"version" => @version,
|
2233
|
-
"filter" => filter,
|
2234
2257
|
"sort" => sort,
|
2258
|
+
"filter" => filter,
|
2235
2259
|
"page_limit" => page_limit,
|
2236
2260
|
"cursor" => cursor
|
2237
2261
|
}
|
2238
2262
|
|
2239
|
-
method_url = "/v1/logs"
|
2263
|
+
method_url = "/v1/workspaces/%s/logs" % [ERB::Util.url_encode(workspace_id)]
|
2240
2264
|
|
2241
2265
|
response = request(
|
2242
2266
|
method: "GET",
|
@@ -2249,39 +2273,40 @@ module IBMWatson
|
|
2249
2273
|
end
|
2250
2274
|
|
2251
2275
|
##
|
2252
|
-
# @!method
|
2253
|
-
# List log events in
|
2254
|
-
# List the events from the
|
2276
|
+
# @!method list_all_logs(filter:, sort: nil, page_limit: nil, cursor: nil)
|
2277
|
+
# List log events in all workspaces.
|
2278
|
+
# List the events from the logs of all workspaces in the service instance.
|
2255
2279
|
#
|
2256
2280
|
# If **cursor** is not specified, this operation is limited to 40 requests per 30
|
2257
2281
|
# minutes. If **cursor** is specified, the limit is 120 requests per minute. For
|
2258
2282
|
# more information, see **Rate limiting**.
|
2259
|
-
# @param
|
2283
|
+
# @param filter [String] A cacheable parameter that limits the results to those matching the specified
|
2284
|
+
# filter. You must specify a filter query that includes a value for `language`, as
|
2285
|
+
# well as a value for `workspace_id` or `request.context.metadata.deployment`. For
|
2286
|
+
# more information, see the
|
2287
|
+
# [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-filter-reference#filter-reference).
|
2260
2288
|
# @param sort [String] How to sort the returned log events. You can sort by **request_timestamp**. To
|
2261
2289
|
# reverse the sort order, prefix the parameter value with a minus sign (`-`).
|
2262
|
-
# @param filter [String] A cacheable parameter that limits the results to those matching the specified
|
2263
|
-
# filter. For more information, see the
|
2264
|
-
# [documentation](https://cloud.ibm.com/docs/services/assistant/filter-reference.html#filter-reference-syntax).
|
2265
2290
|
# @param page_limit [Fixnum] The number of records to return in each page of results.
|
2266
2291
|
# @param cursor [String] A token identifying the page of results to retrieve.
|
2267
2292
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
2268
|
-
def
|
2269
|
-
raise ArgumentError.new("
|
2293
|
+
def list_all_logs(filter:, sort: nil, page_limit: nil, cursor: nil)
|
2294
|
+
raise ArgumentError.new("filter must be provided") if filter.nil?
|
2270
2295
|
|
2271
2296
|
headers = {
|
2272
2297
|
}
|
2273
|
-
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "
|
2298
|
+
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_all_logs")
|
2274
2299
|
headers.merge!(sdk_headers)
|
2275
2300
|
|
2276
2301
|
params = {
|
2277
2302
|
"version" => @version,
|
2278
|
-
"sort" => sort,
|
2279
2303
|
"filter" => filter,
|
2304
|
+
"sort" => sort,
|
2280
2305
|
"page_limit" => page_limit,
|
2281
2306
|
"cursor" => cursor
|
2282
2307
|
}
|
2283
2308
|
|
2284
|
-
method_url = "/v1/
|
2309
|
+
method_url = "/v1/logs"
|
2285
2310
|
|
2286
2311
|
response = request(
|
2287
2312
|
method: "GET",
|
@@ -2305,7 +2330,7 @@ module IBMWatson
|
|
2305
2330
|
# You associate a customer ID with data by passing the `X-Watson-Metadata` header
|
2306
2331
|
# with a request that passes data. For more information about personal data and
|
2307
2332
|
# customer IDs, see [Information
|
2308
|
-
# security](https://cloud.ibm.com/docs/services/assistant
|
2333
|
+
# security](https://cloud.ibm.com/docs/services/assistant?topic=assistant-information-security#information-security).
|
2309
2334
|
# @param customer_id [String] The customer ID for which all data is to be deleted.
|
2310
2335
|
# @return [nil]
|
2311
2336
|
def delete_user_data(customer_id:)
|