@@ -201,7 +201,9 @@ public interface Model {
201
201
protected Boolean splitTranscriptAtPhraseEnd ;
202
202
protected Float speechDetectorSensitivity ;
203
203
protected Float backgroundAudioSuppression ;
204
+ protected Boolean lowLatency ;
204
205
protected Float characterInsertionBias ;
206
+ private Boolean interimResults ;
205
207
private Boolean processingMetrics ;
206
208
private Float processingMetricsInterval ;
207
209
@@ -232,7 +234,9 @@ public static class Builder {
232
234
private Boolean splitTranscriptAtPhraseEnd ;
233
235
private Float speechDetectorSensitivity ;
234
236
private Float backgroundAudioSuppression ;
237
+ private Boolean lowLatency ;
235
238
private Float characterInsertionBias ;
239
+ private Boolean interimResults ;
236
240
private Boolean processingMetrics ;
237
241
private Float processingMetricsInterval ;
238
242
@@ -262,7 +266,9 @@ private Builder(RecognizeWithWebsocketsOptions recognizeWithWebsocketsOptions) {
262
266
this .splitTranscriptAtPhraseEnd = recognizeWithWebsocketsOptions .splitTranscriptAtPhraseEnd ;
263
267
this .speechDetectorSensitivity = recognizeWithWebsocketsOptions .speechDetectorSensitivity ;
264
268
this .backgroundAudioSuppression = recognizeWithWebsocketsOptions .backgroundAudioSuppression ;
269
+ this .lowLatency = recognizeWithWebsocketsOptions .lowLatency ;
265
270
this .characterInsertionBias = recognizeWithWebsocketsOptions .characterInsertionBias ;
271
+ this .interimResults = recognizeWithWebsocketsOptions .interimResults ;
266
272
this .processingMetrics = recognizeWithWebsocketsOptions .processingMetrics ;
267
273
this .processingMetricsInterval = recognizeWithWebsocketsOptions .processingMetricsInterval ;
268
274
}
@@ -578,6 +584,17 @@ public Builder backgroundAudioSuppression(Float backgroundAudioSuppression) {
578
584
return this ;
579
585
}
580
586
587
+ /**
588
+ * Set the lowLatency.
589
+ *
590
+ * @param lowLatency the lowLatency
591
+ * @return the RecognizeOptions builder
592
+ */
593
+ public Builder lowLatency (Boolean lowLatency ) {
594
+ this .lowLatency = lowLatency ;
595
+ return this ;
596
+ }
597
+
581
598
/**
582
599
* Set the characterInsertionBias.
583
600
*
@@ -589,6 +606,19 @@ public Builder characterInsertionBias(Float characterInsertionBias) {
589
606
return this ;
590
607
}
591
608
609
+ /**
610
+ * Set the interimResults.
611
+ *
612
+ * <p>NOTE: This parameter only works for the `recognizeUsingWebSocket` method.
613
+ *
614
+ * @param interimResults the interimResults
615
+ * @return the interimResults
616
+ */
617
+ public Builder interimResults (Boolean interimResults ) {
618
+ this .interimResults = interimResults ;
619
+ return this ;
620
+ }
621
+
592
622
/**
593
623
* Set the audio.
594
624
*
@@ -655,7 +685,9 @@ protected RecognizeWithWebsocketsOptions(Builder builder) {
655
685
splitTranscriptAtPhraseEnd = builder .splitTranscriptAtPhraseEnd ;
656
686
speechDetectorSensitivity = builder .speechDetectorSensitivity ;
657
687
backgroundAudioSuppression = builder .backgroundAudioSuppression ;
688
+ lowLatency = builder .lowLatency ;
658
689
characterInsertionBias = builder .characterInsertionBias ;
690
+ interimResults = builder .interimResults ;
659
691
processingMetrics = builder .processingMetrics ;
660
692
processingMetricsInterval = builder .processingMetricsInterval ;
661
693
}
@@ -1091,6 +1123,28 @@ public Float backgroundAudioSuppression() {
1091
1123
return backgroundAudioSuppression ;
1092
1124
}
1093
1125
1126
+ /**
1127
+ * Gets the lowLatency.
1128
+ *
1129
+ * <p>If `true` for next-generation `Multimedia` and `Telephony` models that support low latency,
1130
+ * directs the service to produce results even more quickly than it usually does. Next-generation
1131
+ * models produce transcription results faster than previous-generation models. The `low_latency`
1132
+ * parameter causes the models to produce results even more quickly, though the results might be
1133
+ * less accurate when the parameter is used.
1134
+ *
1135
+ * <p>The parameter is not available for previous-generation `Broadband` and `Narrowband` models.
1136
+ * It is available for most next-generation models. * For a list of next-generation models that
1137
+ * support low latency, see [Supported next-generation language
1138
+ * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng#models-ng-supported).
1139
+ * * For more information about the `low_latency` parameter, see [Low
1140
+ * latency](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-interim#low-latency).
1141
+ *
1142
+ * @return the lowLatency
1143
+ */
1144
+ public Boolean lowLatency () {
1145
+ return lowLatency ;
1146
+ }
1147
+
1094
1148
/**
1095
1149
* Gets the characterInsertionBias.
1096
1150
*
@@ -1122,6 +1176,21 @@ public Float characterInsertionBias() {
1122
1176
return characterInsertionBias ;
1123
1177
}
1124
1178
1179
+ /**
1180
+ * Gets the interimResults.
1181
+ *
1182
+ * <p>If `true`, the service returns interim results as a stream of `SpeechRecognitionResults`
1183
+ * objects. By default, the service returns a single `SpeechRecognitionResults` object with final
1184
+ * results only.
1185
+ *
1186
+ * <p>NOTE: This parameter only works for the `recognizeUsingWebSocket` method.
1187
+ *
1188
+ * @return the interimResults
1189
+ */
1190
+ public Boolean interimResults () {
1191
+ return interimResults ;
1192
+ }
1193
+
1125
1194
/**
1126
1195
* Gets the processingMetrics.
1127
1196
*
0 commit comments