@@ -117,6 +117,7 @@ public interface Model {
117117 private Boolean profanityFilter ;
118118 private Boolean smartFormatting ;
119119 private Boolean speakerLabels ;
120+ private Boolean interimResults ;
120121
121122 /**
122123 * Builder.
@@ -139,6 +140,7 @@ public static class Builder {
139140 private Boolean profanityFilter ;
140141 private Boolean smartFormatting ;
141142 private Boolean speakerLabels ;
143+ private Boolean interimResults ;
142144
143145 private Builder (RecognizeOptions recognizeOptions ) {
144146 audio = recognizeOptions .audio ;
@@ -158,6 +160,7 @@ private Builder(RecognizeOptions recognizeOptions) {
158160 profanityFilter = recognizeOptions .profanityFilter ;
159161 smartFormatting = recognizeOptions .smartFormatting ;
160162 speakerLabels = recognizeOptions .speakerLabels ;
163+ interimResults = recognizeOptions .interimResults ;
161164 }
162165
163166 /**
@@ -378,6 +381,19 @@ public Builder speakerLabels(Boolean speakerLabels) {
378381 return this ;
379382 }
380383
384+ /**
385+ * Set the interimResults.
386+ *
387+ * NOTE: This parameter only works for the `recognizeUsingWebSocket` method.
388+ *
389+ * @param interimResults the interimResults
390+ * @return the interimResults
391+ */
392+ public Builder interimResults (Boolean interimResults ) {
393+ this .interimResults = interimResults ;
394+ return this ;
395+ }
396+
381397 /**
382398 * Set the audio.
383399 *
@@ -411,6 +427,7 @@ private RecognizeOptions(Builder builder) {
411427 profanityFilter = builder .profanityFilter ;
412428 smartFormatting = builder .smartFormatting ;
413429 speakerLabels = builder .speakerLabels ;
430+ interimResults = builder .interimResults ;
414431 }
415432
416433 /**
@@ -650,4 +667,18 @@ public Boolean smartFormatting() {
650667 public Boolean speakerLabels () {
651668 return speakerLabels ;
652669 }
670+
671+ /**
672+ * Gets the interimResults.
673+ *
674+ * If `true`, the service returns interim results as a stream of `SpeechRecognitionResults` objects. By default,
675+ * the service returns a single `SpeechRecognitionResults` object with final results only.
676+ *
677+ * NOTE: This parameter only works for the `recognizeUsingWebSocket` method.
678+ *
679+ * @return the interimResults
680+ */
681+ public Boolean interimResults () {
682+ return interimResults ;
683+ }
653684}
0 commit comments