From eecf18b4760e1f3c1c27de6aa5841a075b47edff Mon Sep 17 00:00:00 2001 From: Anthony Oliveri Date: Mon, 11 Feb 2019 15:18:39 -0600 Subject: [PATCH] feat(SpeechToTextV1): Add new parameter `force` to upgradeAcousticModel() method --- Source/SpeechToTextV1/SpeechToText.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/SpeechToTextV1/SpeechToText.swift b/Source/SpeechToTextV1/SpeechToText.swift index bf9e0e803..925fe2cce 100644 --- a/Source/SpeechToTextV1/SpeechToText.swift +++ b/Source/SpeechToTextV1/SpeechToText.swift @@ -2765,12 +2765,18 @@ public class SpeechToText { - parameter customLanguageModelID: If the custom acoustic model was trained with a custom language model, the customization ID (GUID) of that custom language model. The custom language model must be upgraded before the custom acoustic model can be upgraded. The credentials specified with the request must own both custom models. + - parameter force: If `true`, forces the upgrade of a custom acoustic model for which no input data has been + modified since it was last trained. Use this parameter only to force the upgrade of a custom acoustic model that + is trained with a custom language model, and only if you receive a 400 response code and the message `No input + data modified since last training`. See [Upgrading a custom acoustic + model](https://cloud.ibm.com/docs/services/speech-to-text/custom-upgrade.html#upgradeAcoustic). - parameter headers: A dictionary of request headers to be sent with this request. - parameter completionHandler: A function executed when the request completes with a successful result or error */ public func upgradeAcousticModel( customizationID: String, customLanguageModelID: String? = nil, + force: Bool? = nil, headers: [String: String]? = nil, completionHandler: @escaping (WatsonResponse?, WatsonError?) -> Void) { @@ -2789,6 +2795,10 @@ public class SpeechToText { let queryParameter = URLQueryItem(name: "custom_language_model_id", value: customLanguageModelID) queryParameters.append(queryParameter) } + if let force = force { + let queryParameter = URLQueryItem(name: "force", value: "\(force)") + queryParameters.append(queryParameter) + } // construct REST request let path = "/v1/acoustic_customizations/\(customizationID)/upgrade_model"