ibm_watson 0.13.0 → 0.14.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/lib/ibm_watson/assistant_v1.rb +84 -85
- data/lib/ibm_watson/assistant_v2.rb +8 -9
- data/lib/ibm_watson/common.rb +1 -1
- data/lib/ibm_watson/compare_comply_v1.rb +27 -28
- data/lib/ibm_watson/discovery_v1.rb +124 -125
- data/lib/ibm_watson/language_translator_v3.rb +17 -18
- data/lib/ibm_watson/natural_language_classifier_v1.rb +14 -15
- data/lib/ibm_watson/natural_language_understanding_v1.rb +9 -10
- data/lib/ibm_watson/personality_insights_v3.rb +5 -6
- data/lib/ibm_watson/speech_to_text_v1.rb +68 -69
- data/lib/ibm_watson/text_to_speech_v1.rb +27 -28
- data/lib/ibm_watson/tone_analyzer_v3.rb +7 -8
- data/lib/ibm_watson/version.rb +1 -1
- data/lib/ibm_watson/visual_recognition_v3.rb +24 -23
- data/test/integration/test_iam_assistant_v1.rb +1 -1
- data/test/integration/test_speech_to_text_v1.rb +1 -1
- data/test/unit/test_assistant_v1.rb +2 -2
- data/test/unit/test_configure_http_client.rb +1 -1
- data/test/unit/test_personality_insights_v3.rb +4 -4
- data/test/unit/test_tone_analyzer_v3.rb +4 -5
- data/test/unit/test_vcap_using_personality_insights.rb +4 -4
- metadata +16 -7
- data/lib/ibm_watson/detailed_response.rb +0 -21
- data/lib/ibm_watson/iam_token_manager.rb +0 -152
- data/lib/ibm_watson/watson_api_exception.rb +0 -41
- data/lib/ibm_watson/watson_service.rb +0 -285
- data/test/unit/test_iam_token_manager.rb +0 -175
@@ -41,16 +41,15 @@
|
|
41
41
|
require "concurrent"
|
42
42
|
require "erb"
|
43
43
|
require "json"
|
44
|
-
require_relative "./detailed_response"
|
45
|
-
require_relative "./common.rb"
|
46
44
|
|
47
|
-
|
45
|
+
require "ibm_cloud_sdk_core"
|
46
|
+
require_relative "./common.rb"
|
48
47
|
|
49
48
|
# Module for the Watson APIs
|
50
49
|
module IBMWatson
|
51
50
|
##
|
52
51
|
# The Speech to Text V1 service.
|
53
|
-
class SpeechToTextV1 <
|
52
|
+
class SpeechToTextV1 < IBMCloudSdkCore::BaseService
|
54
53
|
include Concurrent::Async
|
55
54
|
##
|
56
55
|
# @!method initialize(args)
|
@@ -107,11 +106,11 @@ module IBMWatson
|
|
107
106
|
#
|
108
107
|
# **See also:** [Languages and
|
109
108
|
# models](https://cloud.ibm.com/docs/services/speech-to-text/models.html).
|
110
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
109
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
111
110
|
def list_models
|
112
111
|
headers = {
|
113
112
|
}
|
114
|
-
headers = Common.new.
|
113
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "list_models")
|
115
114
|
|
116
115
|
method_url = "/v1/models"
|
117
116
|
|
@@ -135,13 +134,13 @@ module IBMWatson
|
|
135
134
|
# models](https://cloud.ibm.com/docs/services/speech-to-text/models.html).
|
136
135
|
# @param model_id [String] The identifier of the model in the form of its name from the output of the **Get a
|
137
136
|
# model** method.
|
138
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
137
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
139
138
|
def get_model(model_id:)
|
140
139
|
raise ArgumentError.new("model_id must be provided") if model_id.nil?
|
141
140
|
|
142
141
|
headers = {
|
143
142
|
}
|
144
|
-
headers = Common.new.
|
143
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "get_model")
|
145
144
|
|
146
145
|
method_url = "/v1/models/%s" % [ERB::Util.url_encode(model_id)]
|
147
146
|
|
@@ -371,7 +370,7 @@ module IBMWatson
|
|
371
370
|
#
|
372
371
|
# See [Numeric
|
373
372
|
# redaction](https://cloud.ibm.com/docs/services/speech-to-text/output.html#redaction).
|
374
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
373
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
375
374
|
def recognize(audio:, content_type: nil, model: nil, language_customization_id: nil, acoustic_customization_id: nil, base_model_version: nil, customization_weight: nil, inactivity_timeout: nil, keywords: nil, keywords_threshold: nil, max_alternatives: nil, word_alternatives_threshold: nil, word_confidence: nil, timestamps: nil, profanity_filter: nil, smart_formatting: nil, speaker_labels: nil, customization_id: nil, grammar_name: nil, redaction: nil)
|
376
375
|
raise ArgumentError.new("audio must be provided") if audio.nil?
|
377
376
|
|
@@ -379,7 +378,7 @@ module IBMWatson
|
|
379
378
|
"Content-Type" => content_type
|
380
379
|
}
|
381
380
|
keywords *= "," unless keywords.nil?
|
382
|
-
headers = Common.new.
|
381
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "recognize")
|
383
382
|
|
384
383
|
params = {
|
385
384
|
"model" => model,
|
@@ -418,7 +417,7 @@ module IBMWatson
|
|
418
417
|
end
|
419
418
|
|
420
419
|
##
|
421
|
-
# @!method recognize_using_websocket(content_type
|
420
|
+
# @!method recognize_using_websocket(content_type:,recognize_callback:,audio: nil,chunk_data: false,model: nil,customization_id: nil,acoustic_customization_id: nil,customization_weight: nil,base_model_version: nil,inactivity_timeout: nil,interim_results: nil,keywords: nil,keywords_threshold: nil,max_alternatives: nil,word_alternatives_threshold: nil,word_confidence: nil,timestamps: nil,profanity_filter: nil,smart_formatting: nil,speaker_labels: nil)
|
422
421
|
# Sends audio for speech recognition using web sockets.
|
423
422
|
# @param content_type [String] The type of the input: audio/basic, audio/flac, audio/l16, audio/mp3, audio/mpeg, audio/mulaw, audio/ogg, audio/ogg;codecs=opus, audio/ogg;codecs=vorbis, audio/wav, audio/webm, audio/webm;codecs=opus, audio/webm;codecs=vorbis, or multipart/form-data.
|
424
423
|
# @param recognize_callback [RecognizeCallback] The instance handling events returned from the service.
|
@@ -495,7 +494,7 @@ module IBMWatson
|
|
495
494
|
require_relative("./websocket/speech_to_text_websocket_listener.rb")
|
496
495
|
headers = {
|
497
496
|
}
|
498
|
-
headers = Common.new.
|
497
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "recognize_using_websocket")
|
499
498
|
headers = conn.default_options.headers.to_hash unless conn.default_options.headers.to_hash.empty?
|
500
499
|
if !token_manager.nil?
|
501
500
|
access_token = token_manager.token
|
@@ -537,7 +536,7 @@ module IBMWatson
|
|
537
536
|
# :nocov:
|
538
537
|
# @deprecated This will method be removed in the next major release. Use {#recognize_using_websocket} instead.
|
539
538
|
def recognize_with_websocket(
|
540
|
-
content_type
|
539
|
+
content_type:,
|
541
540
|
recognize_callback:,
|
542
541
|
audio: nil,
|
543
542
|
chunk_data: false,
|
@@ -634,13 +633,13 @@ module IBMWatson
|
|
634
633
|
# header during URL verification and with every notification sent to the callback
|
635
634
|
# URL. It calculates the signature over the payload of the notification. If you omit
|
636
635
|
# the parameter, the service does not send the header.
|
637
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
636
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
638
637
|
def register_callback(callback_url:, user_secret: nil)
|
639
638
|
raise ArgumentError.new("callback_url must be provided") if callback_url.nil?
|
640
639
|
|
641
640
|
headers = {
|
642
641
|
}
|
643
|
-
headers = Common.new.
|
642
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "register_callback")
|
644
643
|
|
645
644
|
params = {
|
646
645
|
"callback_url" => callback_url,
|
@@ -675,7 +674,7 @@ module IBMWatson
|
|
675
674
|
|
676
675
|
headers = {
|
677
676
|
}
|
678
|
-
headers = Common.new.
|
677
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "unregister_callback")
|
679
678
|
|
680
679
|
params = {
|
681
680
|
"callback_url" => callback_url
|
@@ -952,14 +951,14 @@ module IBMWatson
|
|
952
951
|
#
|
953
952
|
# See [Numeric
|
954
953
|
# redaction](https://cloud.ibm.com/docs/services/speech-to-text/output.html#redaction).
|
955
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
954
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
956
955
|
def create_job(audio:, content_type: nil, model: nil, callback_url: nil, events: nil, user_token: nil, results_ttl: nil, language_customization_id: nil, acoustic_customization_id: nil, base_model_version: nil, customization_weight: nil, inactivity_timeout: nil, keywords: nil, keywords_threshold: nil, max_alternatives: nil, word_alternatives_threshold: nil, word_confidence: nil, timestamps: nil, profanity_filter: nil, smart_formatting: nil, speaker_labels: nil, customization_id: nil, grammar_name: nil, redaction: nil)
|
957
956
|
raise ArgumentError.new("audio must be provided") if audio.nil?
|
958
957
|
|
959
958
|
headers = {
|
960
959
|
"Content-Type" => content_type
|
961
960
|
}
|
962
|
-
headers = Common.new.
|
961
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "create_job")
|
963
962
|
|
964
963
|
params = {
|
965
964
|
"model" => model,
|
@@ -1015,11 +1014,11 @@ module IBMWatson
|
|
1015
1014
|
#
|
1016
1015
|
# **See also:** [Checking the status of the latest
|
1017
1016
|
# jobs](https://cloud.ibm.com/docs/services/speech-to-text/async.html#jobs).
|
1018
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1017
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1019
1018
|
def check_jobs
|
1020
1019
|
headers = {
|
1021
1020
|
}
|
1022
|
-
headers = Common.new.
|
1021
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "check_jobs")
|
1023
1022
|
|
1024
1023
|
method_url = "/v1/recognitions"
|
1025
1024
|
|
@@ -1052,13 +1051,13 @@ module IBMWatson
|
|
1052
1051
|
# @param id [String] The identifier of the asynchronous job that is to be used for the request. You
|
1053
1052
|
# must make the request with credentials for the instance of the service that owns
|
1054
1053
|
# the job.
|
1055
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1054
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1056
1055
|
def check_job(id:)
|
1057
1056
|
raise ArgumentError.new("id must be provided") if id.nil?
|
1058
1057
|
|
1059
1058
|
headers = {
|
1060
1059
|
}
|
1061
|
-
headers = Common.new.
|
1060
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "check_job")
|
1062
1061
|
|
1063
1062
|
method_url = "/v1/recognitions/%s" % [ERB::Util.url_encode(id)]
|
1064
1063
|
|
@@ -1091,7 +1090,7 @@ module IBMWatson
|
|
1091
1090
|
|
1092
1091
|
headers = {
|
1093
1092
|
}
|
1094
|
-
headers = Common.new.
|
1093
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "delete_job")
|
1095
1094
|
|
1096
1095
|
method_url = "/v1/recognitions/%s" % [ERB::Util.url_encode(id)]
|
1097
1096
|
|
@@ -1142,7 +1141,7 @@ module IBMWatson
|
|
1142
1141
|
# English language models.
|
1143
1142
|
# @param description [String] A description of the new custom language model. Use a localized description that
|
1144
1143
|
# matches the language of the custom model.
|
1145
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1144
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1146
1145
|
def create_language_model(name:, base_model_name:, dialect: nil, description: nil)
|
1147
1146
|
raise ArgumentError.new("name must be provided") if name.nil?
|
1148
1147
|
|
@@ -1150,7 +1149,7 @@ module IBMWatson
|
|
1150
1149
|
|
1151
1150
|
headers = {
|
1152
1151
|
}
|
1153
|
-
headers = Common.new.
|
1152
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "create_language_model")
|
1154
1153
|
|
1155
1154
|
data = {
|
1156
1155
|
"name" => name,
|
@@ -1185,11 +1184,11 @@ module IBMWatson
|
|
1185
1184
|
# @param language [String] The identifier of the language for which custom language or custom acoustic models
|
1186
1185
|
# are to be returned (for example, `en-US`). Omit the parameter to see all custom
|
1187
1186
|
# language or custom acoustic models that are owned by the requesting credentials.
|
1188
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1187
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1189
1188
|
def list_language_models(language: nil)
|
1190
1189
|
headers = {
|
1191
1190
|
}
|
1192
|
-
headers = Common.new.
|
1191
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "list_language_models")
|
1193
1192
|
|
1194
1193
|
params = {
|
1195
1194
|
"language" => language
|
@@ -1218,13 +1217,13 @@ module IBMWatson
|
|
1218
1217
|
# @param customization_id [String] The customization ID (GUID) of the custom language model that is to be used for
|
1219
1218
|
# the request. You must make the request with credentials for the instance of the
|
1220
1219
|
# service that owns the custom model.
|
1221
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1220
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1222
1221
|
def get_language_model(customization_id:)
|
1223
1222
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
1224
1223
|
|
1225
1224
|
headers = {
|
1226
1225
|
}
|
1227
|
-
headers = Common.new.
|
1226
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "get_language_model")
|
1228
1227
|
|
1229
1228
|
method_url = "/v1/customizations/%s" % [ERB::Util.url_encode(customization_id)]
|
1230
1229
|
|
@@ -1256,7 +1255,7 @@ module IBMWatson
|
|
1256
1255
|
|
1257
1256
|
headers = {
|
1258
1257
|
}
|
1259
|
-
headers = Common.new.
|
1258
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "delete_language_model")
|
1260
1259
|
|
1261
1260
|
method_url = "/v1/customizations/%s" % [ERB::Util.url_encode(customization_id)]
|
1262
1261
|
|
@@ -1332,7 +1331,7 @@ module IBMWatson
|
|
1332
1331
|
|
1333
1332
|
headers = {
|
1334
1333
|
}
|
1335
|
-
headers = Common.new.
|
1334
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "train_language_model")
|
1336
1335
|
|
1337
1336
|
params = {
|
1338
1337
|
"word_type_to_add" => word_type_to_add,
|
@@ -1372,7 +1371,7 @@ module IBMWatson
|
|
1372
1371
|
|
1373
1372
|
headers = {
|
1374
1373
|
}
|
1375
|
-
headers = Common.new.
|
1374
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "reset_language_model")
|
1376
1375
|
|
1377
1376
|
method_url = "/v1/customizations/%s/reset" % [ERB::Util.url_encode(customization_id)]
|
1378
1377
|
|
@@ -1415,7 +1414,7 @@ module IBMWatson
|
|
1415
1414
|
|
1416
1415
|
headers = {
|
1417
1416
|
}
|
1418
|
-
headers = Common.new.
|
1417
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "upgrade_language_model")
|
1419
1418
|
|
1420
1419
|
method_url = "/v1/customizations/%s/upgrade_model" % [ERB::Util.url_encode(customization_id)]
|
1421
1420
|
|
@@ -1444,13 +1443,13 @@ module IBMWatson
|
|
1444
1443
|
# @param customization_id [String] The customization ID (GUID) of the custom language model that is to be used for
|
1445
1444
|
# the request. You must make the request with credentials for the instance of the
|
1446
1445
|
# service that owns the custom model.
|
1447
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1446
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1448
1447
|
def list_corpora(customization_id:)
|
1449
1448
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
1450
1449
|
|
1451
1450
|
headers = {
|
1452
1451
|
}
|
1453
|
-
headers = Common.new.
|
1452
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "list_corpora")
|
1454
1453
|
|
1455
1454
|
method_url = "/v1/customizations/%s/corpora" % [ERB::Util.url_encode(customization_id)]
|
1456
1455
|
|
@@ -1549,7 +1548,7 @@ module IBMWatson
|
|
1549
1548
|
|
1550
1549
|
headers = {
|
1551
1550
|
}
|
1552
|
-
headers = Common.new.
|
1551
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "add_corpus")
|
1553
1552
|
|
1554
1553
|
params = {
|
1555
1554
|
"allow_overwrite" => allow_overwrite
|
@@ -1590,7 +1589,7 @@ module IBMWatson
|
|
1590
1589
|
# the request. You must make the request with credentials for the instance of the
|
1591
1590
|
# service that owns the custom model.
|
1592
1591
|
# @param corpus_name [String] The name of the corpus for the custom language model.
|
1593
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1592
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1594
1593
|
def get_corpus(customization_id:, corpus_name:)
|
1595
1594
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
1596
1595
|
|
@@ -1598,7 +1597,7 @@ module IBMWatson
|
|
1598
1597
|
|
1599
1598
|
headers = {
|
1600
1599
|
}
|
1601
|
-
headers = Common.new.
|
1600
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "get_corpus")
|
1602
1601
|
|
1603
1602
|
method_url = "/v1/customizations/%s/corpora/%s" % [ERB::Util.url_encode(customization_id), ERB::Util.url_encode(corpus_name)]
|
1604
1603
|
|
@@ -1637,7 +1636,7 @@ module IBMWatson
|
|
1637
1636
|
|
1638
1637
|
headers = {
|
1639
1638
|
}
|
1640
|
-
headers = Common.new.
|
1639
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "delete_corpus")
|
1641
1640
|
|
1642
1641
|
method_url = "/v1/customizations/%s/corpora/%s" % [ERB::Util.url_encode(customization_id), ERB::Util.url_encode(corpus_name)]
|
1643
1642
|
|
@@ -1681,13 +1680,13 @@ module IBMWatson
|
|
1681
1680
|
# lexicographical precedence is numeric values, uppercase letters, and lowercase
|
1682
1681
|
# letters. For count ordering, values with the same count are ordered
|
1683
1682
|
# alphabetically. With the `curl` command, URL encode the `+` symbol as `%2B`.
|
1684
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1683
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1685
1684
|
def list_words(customization_id:, word_type: nil, sort: nil)
|
1686
1685
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
1687
1686
|
|
1688
1687
|
headers = {
|
1689
1688
|
}
|
1690
|
-
headers = Common.new.
|
1689
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "list_words")
|
1691
1690
|
|
1692
1691
|
params = {
|
1693
1692
|
"word_type" => word_type,
|
@@ -1778,7 +1777,7 @@ module IBMWatson
|
|
1778
1777
|
|
1779
1778
|
headers = {
|
1780
1779
|
}
|
1781
|
-
headers = Common.new.
|
1780
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "add_words")
|
1782
1781
|
|
1783
1782
|
data = {
|
1784
1783
|
"words" => words
|
@@ -1871,7 +1870,7 @@ module IBMWatson
|
|
1871
1870
|
|
1872
1871
|
headers = {
|
1873
1872
|
}
|
1874
|
-
headers = Common.new.
|
1873
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "add_word")
|
1875
1874
|
|
1876
1875
|
data = {
|
1877
1876
|
"word" => word,
|
@@ -1906,7 +1905,7 @@ module IBMWatson
|
|
1906
1905
|
# @param word_name [String] The custom word that is to be read from the custom language model. URL-encode the
|
1907
1906
|
# word if it includes non-ASCII characters. For more information, see [Character
|
1908
1907
|
# encoding](https://cloud.ibm.com/docs/services/speech-to-text/language-resource.html#charEncoding).
|
1909
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1908
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1910
1909
|
def get_word(customization_id:, word_name:)
|
1911
1910
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
1912
1911
|
|
@@ -1914,7 +1913,7 @@ module IBMWatson
|
|
1914
1913
|
|
1915
1914
|
headers = {
|
1916
1915
|
}
|
1917
|
-
headers = Common.new.
|
1916
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "get_word")
|
1918
1917
|
|
1919
1918
|
method_url = "/v1/customizations/%s/words/%s" % [ERB::Util.url_encode(customization_id), ERB::Util.url_encode(word_name)]
|
1920
1919
|
|
@@ -1954,7 +1953,7 @@ module IBMWatson
|
|
1954
1953
|
|
1955
1954
|
headers = {
|
1956
1955
|
}
|
1957
|
-
headers = Common.new.
|
1956
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "delete_word")
|
1958
1957
|
|
1959
1958
|
method_url = "/v1/customizations/%s/words/%s" % [ERB::Util.url_encode(customization_id), ERB::Util.url_encode(word_name)]
|
1960
1959
|
|
@@ -1983,13 +1982,13 @@ module IBMWatson
|
|
1983
1982
|
# @param customization_id [String] The customization ID (GUID) of the custom language model that is to be used for
|
1984
1983
|
# the request. You must make the request with credentials for the instance of the
|
1985
1984
|
# service that owns the custom model.
|
1986
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
1985
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1987
1986
|
def list_grammars(customization_id:)
|
1988
1987
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
1989
1988
|
|
1990
1989
|
headers = {
|
1991
1990
|
}
|
1992
|
-
headers = Common.new.
|
1991
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "list_grammars")
|
1993
1992
|
|
1994
1993
|
method_url = "/v1/customizations/%s/grammars" % [ERB::Util.url_encode(customization_id)]
|
1995
1994
|
|
@@ -2083,7 +2082,7 @@ module IBMWatson
|
|
2083
2082
|
headers = {
|
2084
2083
|
"Content-Type" => content_type
|
2085
2084
|
}
|
2086
|
-
headers = Common.new.
|
2085
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "add_grammar")
|
2087
2086
|
|
2088
2087
|
params = {
|
2089
2088
|
"allow_overwrite" => allow_overwrite
|
@@ -2118,7 +2117,7 @@ module IBMWatson
|
|
2118
2117
|
# the request. You must make the request with credentials for the instance of the
|
2119
2118
|
# service that owns the custom model.
|
2120
2119
|
# @param grammar_name [String] The name of the grammar for the custom language model.
|
2121
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
2120
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
2122
2121
|
def get_grammar(customization_id:, grammar_name:)
|
2123
2122
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
2124
2123
|
|
@@ -2126,7 +2125,7 @@ module IBMWatson
|
|
2126
2125
|
|
2127
2126
|
headers = {
|
2128
2127
|
}
|
2129
|
-
headers = Common.new.
|
2128
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "get_grammar")
|
2130
2129
|
|
2131
2130
|
method_url = "/v1/customizations/%s/grammars/%s" % [ERB::Util.url_encode(customization_id), ERB::Util.url_encode(grammar_name)]
|
2132
2131
|
|
@@ -2164,7 +2163,7 @@ module IBMWatson
|
|
2164
2163
|
|
2165
2164
|
headers = {
|
2166
2165
|
}
|
2167
|
-
headers = Common.new.
|
2166
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "delete_grammar")
|
2168
2167
|
|
2169
2168
|
method_url = "/v1/customizations/%s/grammars/%s" % [ERB::Util.url_encode(customization_id), ERB::Util.url_encode(grammar_name)]
|
2170
2169
|
|
@@ -2204,7 +2203,7 @@ module IBMWatson
|
|
2204
2203
|
# customization](https://cloud.ibm.com/docs/services/speech-to-text/custom.html#languageSupport).
|
2205
2204
|
# @param description [String] A description of the new custom acoustic model. Use a localized description that
|
2206
2205
|
# matches the language of the custom model.
|
2207
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
2206
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
2208
2207
|
def create_acoustic_model(name:, base_model_name:, description: nil)
|
2209
2208
|
raise ArgumentError.new("name must be provided") if name.nil?
|
2210
2209
|
|
@@ -2212,7 +2211,7 @@ module IBMWatson
|
|
2212
2211
|
|
2213
2212
|
headers = {
|
2214
2213
|
}
|
2215
|
-
headers = Common.new.
|
2214
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "create_acoustic_model")
|
2216
2215
|
|
2217
2216
|
data = {
|
2218
2217
|
"name" => name,
|
@@ -2246,11 +2245,11 @@ module IBMWatson
|
|
2246
2245
|
# @param language [String] The identifier of the language for which custom language or custom acoustic models
|
2247
2246
|
# are to be returned (for example, `en-US`). Omit the parameter to see all custom
|
2248
2247
|
# language or custom acoustic models that are owned by the requesting credentials.
|
2249
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
2248
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
2250
2249
|
def list_acoustic_models(language: nil)
|
2251
2250
|
headers = {
|
2252
2251
|
}
|
2253
|
-
headers = Common.new.
|
2252
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "list_acoustic_models")
|
2254
2253
|
|
2255
2254
|
params = {
|
2256
2255
|
"language" => language
|
@@ -2279,13 +2278,13 @@ module IBMWatson
|
|
2279
2278
|
# @param customization_id [String] The customization ID (GUID) of the custom acoustic model that is to be used for
|
2280
2279
|
# the request. You must make the request with credentials for the instance of the
|
2281
2280
|
# service that owns the custom model.
|
2282
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
2281
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
2283
2282
|
def get_acoustic_model(customization_id:)
|
2284
2283
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
2285
2284
|
|
2286
2285
|
headers = {
|
2287
2286
|
}
|
2288
|
-
headers = Common.new.
|
2287
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "get_acoustic_model")
|
2289
2288
|
|
2290
2289
|
method_url = "/v1/acoustic_customizations/%s" % [ERB::Util.url_encode(customization_id)]
|
2291
2290
|
|
@@ -2317,7 +2316,7 @@ module IBMWatson
|
|
2317
2316
|
|
2318
2317
|
headers = {
|
2319
2318
|
}
|
2320
|
-
headers = Common.new.
|
2319
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "delete_acoustic_model")
|
2321
2320
|
|
2322
2321
|
method_url = "/v1/acoustic_customizations/%s" % [ERB::Util.url_encode(customization_id)]
|
2323
2322
|
|
@@ -2391,7 +2390,7 @@ module IBMWatson
|
|
2391
2390
|
|
2392
2391
|
headers = {
|
2393
2392
|
}
|
2394
|
-
headers = Common.new.
|
2393
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "train_acoustic_model")
|
2395
2394
|
|
2396
2395
|
params = {
|
2397
2396
|
"custom_language_model_id" => custom_language_model_id
|
@@ -2429,7 +2428,7 @@ module IBMWatson
|
|
2429
2428
|
|
2430
2429
|
headers = {
|
2431
2430
|
}
|
2432
|
-
headers = Common.new.
|
2431
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "reset_acoustic_model")
|
2433
2432
|
|
2434
2433
|
method_url = "/v1/acoustic_customizations/%s/reset" % [ERB::Util.url_encode(customization_id)]
|
2435
2434
|
|
@@ -2489,7 +2488,7 @@ module IBMWatson
|
|
2489
2488
|
|
2490
2489
|
headers = {
|
2491
2490
|
}
|
2492
|
-
headers = Common.new.
|
2491
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "upgrade_acoustic_model")
|
2493
2492
|
|
2494
2493
|
params = {
|
2495
2494
|
"custom_language_model_id" => custom_language_model_id,
|
@@ -2526,13 +2525,13 @@ module IBMWatson
|
|
2526
2525
|
# @param customization_id [String] The customization ID (GUID) of the custom acoustic model that is to be used for
|
2527
2526
|
# the request. You must make the request with credentials for the instance of the
|
2528
2527
|
# service that owns the custom model.
|
2529
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
2528
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
2530
2529
|
def list_audio(customization_id:)
|
2531
2530
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
2532
2531
|
|
2533
2532
|
headers = {
|
2534
2533
|
}
|
2535
|
-
headers = Common.new.
|
2534
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "list_audio")
|
2536
2535
|
|
2537
2536
|
method_url = "/v1/acoustic_customizations/%s/audio" % [ERB::Util.url_encode(customization_id)]
|
2538
2537
|
|
@@ -2685,7 +2684,7 @@ module IBMWatson
|
|
2685
2684
|
"Content-Type" => content_type,
|
2686
2685
|
"Contained-Content-Type" => contained_content_type
|
2687
2686
|
}
|
2688
|
-
headers = Common.new.
|
2687
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "add_audio")
|
2689
2688
|
|
2690
2689
|
params = {
|
2691
2690
|
"allow_overwrite" => allow_overwrite
|
@@ -2736,7 +2735,7 @@ module IBMWatson
|
|
2736
2735
|
# the request. You must make the request with credentials for the instance of the
|
2737
2736
|
# service that owns the custom model.
|
2738
2737
|
# @param audio_name [String] The name of the audio resource for the custom acoustic model.
|
2739
|
-
# @return [DetailedResponse] A `DetailedResponse` object representing the response.
|
2738
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
2740
2739
|
def get_audio(customization_id:, audio_name:)
|
2741
2740
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
2742
2741
|
|
@@ -2744,7 +2743,7 @@ module IBMWatson
|
|
2744
2743
|
|
2745
2744
|
headers = {
|
2746
2745
|
}
|
2747
|
-
headers = Common.new.
|
2746
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "get_audio")
|
2748
2747
|
|
2749
2748
|
method_url = "/v1/acoustic_customizations/%s/audio/%s" % [ERB::Util.url_encode(customization_id), ERB::Util.url_encode(audio_name)]
|
2750
2749
|
|
@@ -2782,7 +2781,7 @@ module IBMWatson
|
|
2782
2781
|
|
2783
2782
|
headers = {
|
2784
2783
|
}
|
2785
|
-
headers = Common.new.
|
2784
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "delete_audio")
|
2786
2785
|
|
2787
2786
|
method_url = "/v1/acoustic_customizations/%s/audio/%s" % [ERB::Util.url_encode(customization_id), ERB::Util.url_encode(audio_name)]
|
2788
2787
|
|
@@ -2819,7 +2818,7 @@ module IBMWatson
|
|
2819
2818
|
|
2820
2819
|
headers = {
|
2821
2820
|
}
|
2822
|
-
headers = Common.new.
|
2821
|
+
headers = Common.new.get_sdk_headers(headers: headers, service_name: "speech_to_text", service_version: "V1", operation_id: "delete_user_data")
|
2823
2822
|
|
2824
2823
|
params = {
|
2825
2824
|
"customer_id" => customer_id
|