Skip to content

Commit 57483bd

Browse files
committed
feat(Speech to Text): Refactor customizationId to languageCustomizationId, move customizationId to the end of the params
1 parent 6266b4f commit 57483bd

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/IBM.WatsonDeveloperCloud.SpeechToText.v1/ISpeechToTextServiceExtension.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SpeechRecognitionResults Recognize(string contentType,
2727
Stream audio,
2828
string transferEncoding = "",
2929
string model = "en-US_BroadbandModel",
30-
string customizationId = "",
30+
string languageCustomizationId = null,
3131
bool? continuous = null,
3232
int? inactivityTimeout = null,
3333
string[] keywords = null,
@@ -38,6 +38,7 @@ SpeechRecognitionResults Recognize(string contentType,
3838
bool? timestamps = null,
3939
bool profanityFilter = false,
4040
bool? smartFormatting = null,
41-
bool? speakerLabels = null);
41+
bool? speakerLabels = null,
42+
string customizationId = null);
4243
}
4344
}

src/IBM.WatsonDeveloperCloud.SpeechToText.v1/SpeechToTextServiceExtension.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public partial class SpeechToTextService : WatsonService, ISpeechToTextService
5151
/// <param name="smartFormatting"></param>
5252
/// <param name="speakerLabels"></param>
5353
/// <returns></returns>
54-
public SpeechRecognitionResults Recognize(string contentType, Stream audio, string transferEncoding = "", string model = "en-US_BroadbandModel", string customizationId = "", bool? continuous = null, int? inactivityTimeout = null, string[] keywords = null, double? keywordsThreshold = null, int? maxAlternatives = null, double? wordAlternativesThreshold = null, bool? wordConfidence = null, bool? timestamps = null, bool profanityFilter = false, bool? smartFormatting = null, bool? speakerLabels = null)
54+
public SpeechRecognitionResults Recognize(string contentType, Stream audio, string transferEncoding = "", string model = "en-US_BroadbandModel", string languageCustomizationId = null, bool? continuous = null, int? inactivityTimeout = null, string[] keywords = null, double? keywordsThreshold = null, int? maxAlternatives = null, double? wordAlternativesThreshold = null, bool? wordConfidence = null, bool? timestamps = null, bool profanityFilter = false, bool? smartFormatting = null, bool? speakerLabels = null, string customizationId = null)
5555
{
5656
if (audio == null)
5757
throw new ArgumentNullException($"{nameof(audio)}");
@@ -83,8 +83,8 @@ public SpeechRecognitionResults Recognize(string contentType, Stream audio, stri
8383
if (!string.IsNullOrEmpty(transferEncoding))
8484
restRequest.WithHeader("Transfer-Encoding", transferEncoding);
8585

86-
if (!string.IsNullOrEmpty(customizationId))
87-
restRequest.WithArgument("customization_id", customizationId);
86+
if (!string.IsNullOrEmpty(languageCustomizationId))
87+
restRequest.WithArgument("language_customization_id", languageCustomizationId);
8888

8989
if (continuous.HasValue)
9090
restRequest.WithArgument("continuous", continuous.Value);
@@ -119,6 +119,9 @@ public SpeechRecognitionResults Recognize(string contentType, Stream audio, stri
119119
if (speakerLabels.HasValue)
120120
restRequest.WithArgument("speaker_labels", speakerLabels.Value);
121121

122+
if (!string.IsNullOrEmpty(customizationId))
123+
restRequest.WithArgument("customization_id", customizationId);
124+
122125
StreamContent bodyContent = new StreamContent(audio);
123126
bodyContent.Headers.Add("Content-Type", contentType);
124127

0 commit comments

Comments
 (0)