Skip to content

Commit

Permalink
feat(SpeechToTextV1): Add new parameter force to upgradeAcousticMod…
Browse files Browse the repository at this point in the history
…el() method
  • Loading branch information
Anthony Oliveri committed Feb 12, 2019
1 parent 1191aa2 commit eecf18b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Source/SpeechToTextV1/SpeechToText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Void>?, WatsonError?) -> Void)
{
Expand All @@ -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"
Expand Down

0 comments on commit eecf18b

Please sign in to comment.