ibm_watson 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/ibm_watson/assistant_v1.rb +109 -101
- data/lib/ibm_watson/discovery_v1.rb +102 -77
- data/lib/ibm_watson/iam_token_manager.rb +25 -30
- data/lib/ibm_watson/language_translator_v3.rb +8 -77
- data/lib/ibm_watson/natural_language_classifier_v1.rb +11 -77
- data/lib/ibm_watson/natural_language_understanding_v1.rb +20 -82
- data/lib/ibm_watson/personality_insights_v3.rb +5 -77
- data/lib/ibm_watson/speech_to_text_v1.rb +139 -175
- data/lib/ibm_watson/text_to_speech_v1.rb +21 -77
- data/lib/ibm_watson/tone_analyzer_v3.rb +6 -77
- data/lib/ibm_watson/version.rb +1 -1
- data/lib/ibm_watson/visual_recognition_v3.rb +10 -76
- data/lib/ibm_watson/watson_service.rb +23 -17
- data/lib/ibm_watson/websocket/speech_to_text_websocket_listener.rb +1 -0
- data/test/integration/test_iam_assistant_v1.rb +3 -5
- data/test/unit/test_assistant_v1.rb +31 -0
- data/test/unit/test_configure_http_client.rb +0 -18
- data/test/unit/test_iam_token_manager.rb +21 -11
- data/test/unit/test_visual_recognition_v3.rb +1 -2
- metadata +2 -2
@@ -31,7 +31,7 @@ require_relative "./watson_service"
|
|
31
31
|
module IBMWatson
|
32
32
|
##
|
33
33
|
# The Discovery V1 service.
|
34
|
-
class DiscoveryV1
|
34
|
+
class DiscoveryV1 < WatsonService
|
35
35
|
include Concurrent::Async
|
36
36
|
##
|
37
37
|
# @!method initialize(args)
|
@@ -72,7 +72,6 @@ module IBMWatson
|
|
72
72
|
# 'https://iam.ng.bluemix.net/identity/token'.
|
73
73
|
def initialize(args = {})
|
74
74
|
@__async_initialized__ = false
|
75
|
-
super()
|
76
75
|
defaults = {}
|
77
76
|
defaults[:version] = nil
|
78
77
|
defaults[:url] = "https://gateway.watsonplatform.net/discovery/api"
|
@@ -82,84 +81,11 @@ module IBMWatson
|
|
82
81
|
defaults[:iam_access_token] = nil
|
83
82
|
defaults[:iam_url] = nil
|
84
83
|
args = defaults.merge(args)
|
85
|
-
|
86
|
-
|
87
|
-
url: args[:url],
|
88
|
-
username: args[:username],
|
89
|
-
password: args[:password],
|
90
|
-
iam_apikey: args[:iam_apikey],
|
91
|
-
iam_access_token: args[:iam_access_token],
|
92
|
-
iam_url: args[:iam_url],
|
93
|
-
use_vcap_services: true
|
94
|
-
)
|
84
|
+
args[:vcap_services_name] = "discovery"
|
85
|
+
super
|
95
86
|
@version = args[:version]
|
96
87
|
end
|
97
88
|
|
98
|
-
# :nocov:
|
99
|
-
def add_default_headers(headers: {})
|
100
|
-
@watson_service.add_default_headers(headers: headers)
|
101
|
-
end
|
102
|
-
|
103
|
-
def _iam_access_token(iam_access_token:)
|
104
|
-
@watson_service._iam_access_token(iam_access_token: iam_access_token)
|
105
|
-
end
|
106
|
-
|
107
|
-
def _iam_apikey(iam_apikey:)
|
108
|
-
@watson_service._iam_apikey(iam_apikey: iam_apikey)
|
109
|
-
end
|
110
|
-
|
111
|
-
# @return [DetailedResponse]
|
112
|
-
def request(args)
|
113
|
-
@watson_service.request(args)
|
114
|
-
end
|
115
|
-
|
116
|
-
# @note Chainable
|
117
|
-
# @param headers [Hash] Custom headers to be sent with the request
|
118
|
-
# @return [self]
|
119
|
-
def headers(headers)
|
120
|
-
@watson_service.headers(headers)
|
121
|
-
self
|
122
|
-
end
|
123
|
-
|
124
|
-
def password=(password)
|
125
|
-
@watson_service.password = password
|
126
|
-
end
|
127
|
-
|
128
|
-
def password
|
129
|
-
@watson_service.password
|
130
|
-
end
|
131
|
-
|
132
|
-
def username=(username)
|
133
|
-
@watson_service.username = username
|
134
|
-
end
|
135
|
-
|
136
|
-
def username
|
137
|
-
@watson_service.username
|
138
|
-
end
|
139
|
-
|
140
|
-
def url=(url)
|
141
|
-
@watson_service.url = url
|
142
|
-
end
|
143
|
-
|
144
|
-
def url
|
145
|
-
@watson_service.url
|
146
|
-
end
|
147
|
-
|
148
|
-
# @!method configure_http_client(proxy: {}, timeout: {})
|
149
|
-
# Sets the http client config, currently works with timeout and proxies
|
150
|
-
# @param proxy [Hash] The hash of proxy configurations
|
151
|
-
# @option proxy address [String] The address of the proxy
|
152
|
-
# @option proxy port [Integer] The port of the proxy
|
153
|
-
# @option proxy username [String] The username of the proxy, if authentication is needed
|
154
|
-
# @option proxy password [String] The password of the proxy, if authentication is needed
|
155
|
-
# @option proxy headers [Hash] The headers to be used with the proxy
|
156
|
-
# @param timeout [Hash] The hash for configuring timeouts. `per_operation` has priority over `global`
|
157
|
-
# @option timeout per_operation [Hash] Timeouts per operation. Requires `read`, `write`, `connect`
|
158
|
-
# @option timeout global [Integer] Upper bound on total request time
|
159
|
-
def configure_http_client(proxy: {}, timeout: {})
|
160
|
-
@watson_service.configure_http_client(proxy: proxy, timeout: timeout)
|
161
|
-
end
|
162
|
-
# :nocov:
|
163
89
|
#########################
|
164
90
|
# Environments
|
165
91
|
#########################
|
@@ -178,6 +104,7 @@ module IBMWatson
|
|
178
104
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
179
105
|
def create_environment(name:, description: nil, size: nil)
|
180
106
|
raise ArgumentError("name must be provided") if name.nil?
|
107
|
+
|
181
108
|
headers = {
|
182
109
|
}
|
183
110
|
params = {
|
@@ -231,6 +158,7 @@ module IBMWatson
|
|
231
158
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
232
159
|
def get_environment(environment_id:)
|
233
160
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
161
|
+
|
234
162
|
headers = {
|
235
163
|
}
|
236
164
|
params = {
|
@@ -258,6 +186,7 @@ module IBMWatson
|
|
258
186
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
259
187
|
def update_environment(environment_id:, name: nil, description: nil)
|
260
188
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
189
|
+
|
261
190
|
headers = {
|
262
191
|
}
|
263
192
|
params = {
|
@@ -286,6 +215,7 @@ module IBMWatson
|
|
286
215
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
287
216
|
def delete_environment(environment_id:)
|
288
217
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
218
|
+
|
289
219
|
headers = {
|
290
220
|
}
|
291
221
|
params = {
|
@@ -312,7 +242,9 @@ module IBMWatson
|
|
312
242
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
313
243
|
def list_fields(environment_id:, collection_ids:)
|
314
244
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
245
|
+
|
315
246
|
raise ArgumentError("collection_ids must be provided") if collection_ids.nil?
|
247
|
+
|
316
248
|
headers = {
|
317
249
|
}
|
318
250
|
params = {
|
@@ -360,7 +292,9 @@ module IBMWatson
|
|
360
292
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
361
293
|
def create_configuration(environment_id:, name:, description: nil, conversions: nil, enrichments: nil, normalizations: nil, source: nil)
|
362
294
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
295
|
+
|
363
296
|
raise ArgumentError("name must be provided") if name.nil?
|
297
|
+
|
364
298
|
headers = {
|
365
299
|
}
|
366
300
|
params = {
|
@@ -395,6 +329,7 @@ module IBMWatson
|
|
395
329
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
396
330
|
def list_configurations(environment_id:, name: nil)
|
397
331
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
332
|
+
|
398
333
|
headers = {
|
399
334
|
}
|
400
335
|
params = {
|
@@ -420,7 +355,9 @@ module IBMWatson
|
|
420
355
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
421
356
|
def get_configuration(environment_id:, configuration_id:)
|
422
357
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
358
|
+
|
423
359
|
raise ArgumentError("configuration_id must be provided") if configuration_id.nil?
|
360
|
+
|
424
361
|
headers = {
|
425
362
|
}
|
426
363
|
params = {
|
@@ -462,8 +399,11 @@ module IBMWatson
|
|
462
399
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
463
400
|
def update_configuration(environment_id:, configuration_id:, name:, description: nil, conversions: nil, enrichments: nil, normalizations: nil, source: nil)
|
464
401
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
402
|
+
|
465
403
|
raise ArgumentError("configuration_id must be provided") if configuration_id.nil?
|
404
|
+
|
466
405
|
raise ArgumentError("name must be provided") if name.nil?
|
406
|
+
|
467
407
|
headers = {
|
468
408
|
}
|
469
409
|
params = {
|
@@ -503,7 +443,9 @@ module IBMWatson
|
|
503
443
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
504
444
|
def delete_configuration(environment_id:, configuration_id:)
|
505
445
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
446
|
+
|
506
447
|
raise ArgumentError("configuration_id must be provided") if configuration_id.nil?
|
448
|
+
|
507
449
|
headers = {
|
508
450
|
}
|
509
451
|
params = {
|
@@ -558,6 +500,7 @@ module IBMWatson
|
|
558
500
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
559
501
|
def test_configuration_in_environment(environment_id:, configuration: nil, step: nil, configuration_id: nil, file: nil, metadata: nil, file_content_type: nil, filename: nil)
|
560
502
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
503
|
+
|
561
504
|
headers = {
|
562
505
|
}
|
563
506
|
params = {
|
@@ -607,7 +550,9 @@ module IBMWatson
|
|
607
550
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
608
551
|
def create_collection(environment_id:, name:, description: nil, configuration_id: nil, language: nil)
|
609
552
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
553
|
+
|
610
554
|
raise ArgumentError("name must be provided") if name.nil?
|
555
|
+
|
611
556
|
headers = {
|
612
557
|
}
|
613
558
|
params = {
|
@@ -640,6 +585,7 @@ module IBMWatson
|
|
640
585
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
641
586
|
def list_collections(environment_id:, name: nil)
|
642
587
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
588
|
+
|
643
589
|
headers = {
|
644
590
|
}
|
645
591
|
params = {
|
@@ -665,7 +611,9 @@ module IBMWatson
|
|
665
611
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
666
612
|
def get_collection(environment_id:, collection_id:)
|
667
613
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
614
|
+
|
668
615
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
616
|
+
|
669
617
|
headers = {
|
670
618
|
}
|
671
619
|
params = {
|
@@ -693,7 +641,9 @@ module IBMWatson
|
|
693
641
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
694
642
|
def update_collection(environment_id:, collection_id:, name:, description: nil, configuration_id: nil)
|
695
643
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
644
|
+
|
696
645
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
646
|
+
|
697
647
|
headers = {
|
698
648
|
}
|
699
649
|
params = {
|
@@ -724,7 +674,9 @@ module IBMWatson
|
|
724
674
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
725
675
|
def delete_collection(environment_id:, collection_id:)
|
726
676
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
677
|
+
|
727
678
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
679
|
+
|
728
680
|
headers = {
|
729
681
|
}
|
730
682
|
params = {
|
@@ -750,7 +702,9 @@ module IBMWatson
|
|
750
702
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
751
703
|
def list_collection_fields(environment_id:, collection_id:)
|
752
704
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
705
|
+
|
753
706
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
707
|
+
|
754
708
|
headers = {
|
755
709
|
}
|
756
710
|
params = {
|
@@ -780,7 +734,9 @@ module IBMWatson
|
|
780
734
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
781
735
|
def list_expansions(environment_id:, collection_id:)
|
782
736
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
737
|
+
|
783
738
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
739
|
+
|
784
740
|
headers = {
|
785
741
|
}
|
786
742
|
params = {
|
@@ -824,8 +780,11 @@ module IBMWatson
|
|
824
780
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
825
781
|
def create_expansions(environment_id:, collection_id:, expansions:)
|
826
782
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
783
|
+
|
827
784
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
785
|
+
|
828
786
|
raise ArgumentError("expansions must be provided") if expansions.nil?
|
787
|
+
|
829
788
|
headers = {
|
830
789
|
}
|
831
790
|
params = {
|
@@ -856,7 +815,9 @@ module IBMWatson
|
|
856
815
|
# @return [nil]
|
857
816
|
def delete_expansions(environment_id:, collection_id:)
|
858
817
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
818
|
+
|
859
819
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
820
|
+
|
860
821
|
headers = {
|
861
822
|
}
|
862
823
|
params = {
|
@@ -920,7 +881,9 @@ module IBMWatson
|
|
920
881
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
921
882
|
def add_document(environment_id:, collection_id:, file: nil, metadata: nil, file_content_type: nil, filename: nil)
|
922
883
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
884
|
+
|
923
885
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
886
|
+
|
924
887
|
headers = {
|
925
888
|
}
|
926
889
|
params = {
|
@@ -965,8 +928,11 @@ module IBMWatson
|
|
965
928
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
966
929
|
def get_document_status(environment_id:, collection_id:, document_id:)
|
967
930
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
931
|
+
|
968
932
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
933
|
+
|
969
934
|
raise ArgumentError("document_id must be provided") if document_id.nil?
|
935
|
+
|
970
936
|
headers = {
|
971
937
|
}
|
972
938
|
params = {
|
@@ -1005,8 +971,11 @@ module IBMWatson
|
|
1005
971
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1006
972
|
def update_document(environment_id:, collection_id:, document_id:, file: nil, metadata: nil, file_content_type: nil, filename: nil)
|
1007
973
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
974
|
+
|
1008
975
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
976
|
+
|
1009
977
|
raise ArgumentError("document_id must be provided") if document_id.nil?
|
978
|
+
|
1010
979
|
headers = {
|
1011
980
|
}
|
1012
981
|
params = {
|
@@ -1050,8 +1019,11 @@ module IBMWatson
|
|
1050
1019
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1051
1020
|
def delete_document(environment_id:, collection_id:, document_id:)
|
1052
1021
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1022
|
+
|
1053
1023
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1024
|
+
|
1054
1025
|
raise ArgumentError("document_id must be provided") if document_id.nil?
|
1026
|
+
|
1055
1027
|
headers = {
|
1056
1028
|
}
|
1057
1029
|
params = {
|
@@ -1134,7 +1106,9 @@ module IBMWatson
|
|
1134
1106
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1135
1107
|
def query(environment_id:, collection_id:, filter: nil, query: nil, natural_language_query: nil, passages: nil, aggregation: nil, count: nil, return_fields: nil, offset: nil, sort: nil, highlight: nil, passages_fields: nil, passages_count: nil, passages_characters: nil, deduplicate: nil, deduplicate_field: nil, similar: nil, similar_document_ids: nil, similar_fields: nil, logging_opt_out: nil)
|
1136
1108
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1109
|
+
|
1137
1110
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1111
|
+
|
1138
1112
|
headers = {
|
1139
1113
|
"X-Watson-Logging-Opt-Out" => logging_opt_out
|
1140
1114
|
}
|
@@ -1230,7 +1204,9 @@ module IBMWatson
|
|
1230
1204
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1231
1205
|
def query_notices(environment_id:, collection_id:, filter: nil, query: nil, natural_language_query: nil, passages: nil, aggregation: nil, count: nil, return_fields: nil, offset: nil, sort: nil, highlight: nil, passages_fields: nil, passages_count: nil, passages_characters: nil, deduplicate_field: nil, similar: nil, similar_document_ids: nil, similar_fields: nil)
|
1232
1206
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1207
|
+
|
1233
1208
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1209
|
+
|
1234
1210
|
headers = {
|
1235
1211
|
}
|
1236
1212
|
params = {
|
@@ -1326,7 +1302,9 @@ module IBMWatson
|
|
1326
1302
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1327
1303
|
def federated_query(environment_id:, collection_ids:, filter: nil, query: nil, natural_language_query: nil, aggregation: nil, count: nil, return_fields: nil, offset: nil, sort: nil, highlight: nil, deduplicate: nil, deduplicate_field: nil, similar: nil, similar_document_ids: nil, similar_fields: nil, passages: nil, passages_fields: nil, passages_count: nil, passages_characters: nil)
|
1328
1304
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1305
|
+
|
1329
1306
|
raise ArgumentError("collection_ids must be provided") if collection_ids.nil?
|
1307
|
+
|
1330
1308
|
headers = {
|
1331
1309
|
}
|
1332
1310
|
params = {
|
@@ -1415,7 +1393,9 @@ module IBMWatson
|
|
1415
1393
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1416
1394
|
def federated_query_notices(environment_id:, collection_ids:, filter: nil, query: nil, natural_language_query: nil, aggregation: nil, count: nil, return_fields: nil, offset: nil, sort: nil, highlight: nil, deduplicate_field: nil, similar: nil, similar_document_ids: nil, similar_fields: nil)
|
1417
1395
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1396
|
+
|
1418
1397
|
raise ArgumentError("collection_ids must be provided") if collection_ids.nil?
|
1398
|
+
|
1419
1399
|
headers = {
|
1420
1400
|
}
|
1421
1401
|
params = {
|
@@ -1466,7 +1446,9 @@ module IBMWatson
|
|
1466
1446
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1467
1447
|
def query_entities(environment_id:, collection_id:, feature: nil, entity: nil, context: nil, count: nil, evidence_count: nil)
|
1468
1448
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1449
|
+
|
1469
1450
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1451
|
+
|
1470
1452
|
headers = {
|
1471
1453
|
}
|
1472
1454
|
params = {
|
@@ -1513,7 +1495,9 @@ module IBMWatson
|
|
1513
1495
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1514
1496
|
def query_relations(environment_id:, collection_id:, entities: nil, context: nil, sort: nil, filter: nil, count: nil, evidence_count: nil)
|
1515
1497
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1498
|
+
|
1516
1499
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1500
|
+
|
1517
1501
|
headers = {
|
1518
1502
|
}
|
1519
1503
|
params = {
|
@@ -1551,7 +1535,9 @@ module IBMWatson
|
|
1551
1535
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1552
1536
|
def list_training_data(environment_id:, collection_id:)
|
1553
1537
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1538
|
+
|
1554
1539
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1540
|
+
|
1555
1541
|
headers = {
|
1556
1542
|
}
|
1557
1543
|
params = {
|
@@ -1581,7 +1567,9 @@ module IBMWatson
|
|
1581
1567
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1582
1568
|
def add_training_data(environment_id:, collection_id:, natural_language_query: nil, filter: nil, examples: nil)
|
1583
1569
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1570
|
+
|
1584
1571
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1572
|
+
|
1585
1573
|
headers = {
|
1586
1574
|
}
|
1587
1575
|
params = {
|
@@ -1613,7 +1601,9 @@ module IBMWatson
|
|
1613
1601
|
# @return [nil]
|
1614
1602
|
def delete_all_training_data(environment_id:, collection_id:)
|
1615
1603
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1604
|
+
|
1616
1605
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1606
|
+
|
1617
1607
|
headers = {
|
1618
1608
|
}
|
1619
1609
|
params = {
|
@@ -1641,8 +1631,11 @@ module IBMWatson
|
|
1641
1631
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1642
1632
|
def get_training_data(environment_id:, collection_id:, query_id:)
|
1643
1633
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1634
|
+
|
1644
1635
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1636
|
+
|
1645
1637
|
raise ArgumentError("query_id must be provided") if query_id.nil?
|
1638
|
+
|
1646
1639
|
headers = {
|
1647
1640
|
}
|
1648
1641
|
params = {
|
@@ -1670,8 +1663,11 @@ module IBMWatson
|
|
1670
1663
|
# @return [nil]
|
1671
1664
|
def delete_training_data(environment_id:, collection_id:, query_id:)
|
1672
1665
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1666
|
+
|
1673
1667
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1668
|
+
|
1674
1669
|
raise ArgumentError("query_id must be provided") if query_id.nil?
|
1670
|
+
|
1675
1671
|
headers = {
|
1676
1672
|
}
|
1677
1673
|
params = {
|
@@ -1698,8 +1694,11 @@ module IBMWatson
|
|
1698
1694
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1699
1695
|
def list_training_examples(environment_id:, collection_id:, query_id:)
|
1700
1696
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1697
|
+
|
1701
1698
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1699
|
+
|
1702
1700
|
raise ArgumentError("query_id must be provided") if query_id.nil?
|
1701
|
+
|
1703
1702
|
headers = {
|
1704
1703
|
}
|
1705
1704
|
params = {
|
@@ -1729,8 +1728,11 @@ module IBMWatson
|
|
1729
1728
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1730
1729
|
def create_training_example(environment_id:, collection_id:, query_id:, document_id: nil, cross_reference: nil, relevance: nil)
|
1731
1730
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1731
|
+
|
1732
1732
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1733
|
+
|
1733
1734
|
raise ArgumentError("query_id must be provided") if query_id.nil?
|
1735
|
+
|
1734
1736
|
headers = {
|
1735
1737
|
}
|
1736
1738
|
params = {
|
@@ -1764,9 +1766,13 @@ module IBMWatson
|
|
1764
1766
|
# @return [nil]
|
1765
1767
|
def delete_training_example(environment_id:, collection_id:, query_id:, example_id:)
|
1766
1768
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1769
|
+
|
1767
1770
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1771
|
+
|
1768
1772
|
raise ArgumentError("query_id must be provided") if query_id.nil?
|
1773
|
+
|
1769
1774
|
raise ArgumentError("example_id must be provided") if example_id.nil?
|
1775
|
+
|
1770
1776
|
headers = {
|
1771
1777
|
}
|
1772
1778
|
params = {
|
@@ -1796,9 +1802,13 @@ module IBMWatson
|
|
1796
1802
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1797
1803
|
def update_training_example(environment_id:, collection_id:, query_id:, example_id:, cross_reference: nil, relevance: nil)
|
1798
1804
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1805
|
+
|
1799
1806
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1807
|
+
|
1800
1808
|
raise ArgumentError("query_id must be provided") if query_id.nil?
|
1809
|
+
|
1801
1810
|
raise ArgumentError("example_id must be provided") if example_id.nil?
|
1811
|
+
|
1802
1812
|
headers = {
|
1803
1813
|
}
|
1804
1814
|
params = {
|
@@ -1831,9 +1841,13 @@ module IBMWatson
|
|
1831
1841
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1832
1842
|
def get_training_example(environment_id:, collection_id:, query_id:, example_id:)
|
1833
1843
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
1844
|
+
|
1834
1845
|
raise ArgumentError("collection_id must be provided") if collection_id.nil?
|
1846
|
+
|
1835
1847
|
raise ArgumentError("query_id must be provided") if query_id.nil?
|
1848
|
+
|
1836
1849
|
raise ArgumentError("example_id must be provided") if example_id.nil?
|
1850
|
+
|
1837
1851
|
headers = {
|
1838
1852
|
}
|
1839
1853
|
params = {
|
@@ -1867,6 +1881,7 @@ module IBMWatson
|
|
1867
1881
|
# @return [nil]
|
1868
1882
|
def delete_user_data(customer_id:)
|
1869
1883
|
raise ArgumentError("customer_id must be provided") if customer_id.nil?
|
1884
|
+
|
1870
1885
|
headers = {
|
1871
1886
|
}
|
1872
1887
|
params = {
|
@@ -1898,7 +1913,9 @@ module IBMWatson
|
|
1898
1913
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1899
1914
|
def create_event(type:, data:)
|
1900
1915
|
raise ArgumentError("type must be provided") if type.nil?
|
1916
|
+
|
1901
1917
|
raise ArgumentError("data must be provided") if data.nil?
|
1918
|
+
|
1902
1919
|
headers = {
|
1903
1920
|
}
|
1904
1921
|
params = {
|
@@ -2131,6 +2148,7 @@ module IBMWatson
|
|
2131
2148
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
2132
2149
|
def list_credentials(environment_id:)
|
2133
2150
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
2151
|
+
|
2134
2152
|
headers = {
|
2135
2153
|
}
|
2136
2154
|
params = {
|
@@ -2168,6 +2186,7 @@ module IBMWatson
|
|
2168
2186
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
2169
2187
|
def create_credentials(environment_id:, source_type: nil, credential_details: nil)
|
2170
2188
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
2189
|
+
|
2171
2190
|
headers = {
|
2172
2191
|
}
|
2173
2192
|
params = {
|
@@ -2201,7 +2220,9 @@ module IBMWatson
|
|
2201
2220
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
2202
2221
|
def get_credentials(environment_id:, credential_id:)
|
2203
2222
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
2223
|
+
|
2204
2224
|
raise ArgumentError("credential_id must be provided") if credential_id.nil?
|
2225
|
+
|
2205
2226
|
headers = {
|
2206
2227
|
}
|
2207
2228
|
params = {
|
@@ -2239,7 +2260,9 @@ module IBMWatson
|
|
2239
2260
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
2240
2261
|
def update_credentials(environment_id:, credential_id:, source_type: nil, credential_details: nil)
|
2241
2262
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
2263
|
+
|
2242
2264
|
raise ArgumentError("credential_id must be provided") if credential_id.nil?
|
2265
|
+
|
2243
2266
|
headers = {
|
2244
2267
|
}
|
2245
2268
|
params = {
|
@@ -2270,7 +2293,9 @@ module IBMWatson
|
|
2270
2293
|
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
2271
2294
|
def delete_credentials(environment_id:, credential_id:)
|
2272
2295
|
raise ArgumentError("environment_id must be provided") if environment_id.nil?
|
2296
|
+
|
2273
2297
|
raise ArgumentError("credential_id must be provided") if credential_id.nil?
|
2298
|
+
|
2274
2299
|
headers = {
|
2275
2300
|
}
|
2276
2301
|
params = {
|