public static final class StreamingRecognitionResult.Builder extends GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder> implements StreamingRecognitionResultOrBuilder
Contains a speech recognition result corresponding to a portion of the audio
that is currently being processed or an indication that this is the end
of the single requested utterance.
Example:
1. transcript: "tube"
2. transcript: "to be a"
3. transcript: "to be"
4. transcript: "to be or not to be"
is_final: true
5. transcript: " that's"
6. transcript: " that is"
7. recognition_event_type: `RECOGNITION_EVENT_END_OF_SINGLE_UTTERANCE`
8. transcript: " that is the question"
is_final: true
Only two of the responses contain final results (#4 and #8 indicated by
`is_final: true`). Concatenating these generates the full transcript: "to be
or not to be that is the question".
In each response we populate:
* for `MESSAGE_TYPE_TRANSCRIPT`: `transcript` and possibly `is_final`.
* for `MESSAGE_TYPE_END_OF_SINGLE_UTTERANCE`: only `event_type`.
Protobuf type google.cloud.dialogflow.v2beta1.StreamingRecognitionResultgetAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneofmergeFrompublic static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder clear()
clear in interface Message.Builderclear in interface MessageLite.Builderclear in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface Message.BuildergetDescriptorForType in interface MessageOrBuildergetDescriptorForType in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult getDefaultInstanceForType()
getDefaultInstanceForType in interface MessageLiteOrBuildergetDefaultInstanceForType in interface MessageOrBuilderpublic StreamingRecognitionResult build()
build in interface Message.Builderbuild in interface MessageLite.Builderpublic StreamingRecognitionResult buildPartial()
buildPartial in interface Message.BuilderbuildPartial in interface MessageLite.Builderpublic StreamingRecognitionResult.Builder clone()
clone in interface Message.Builderclone in interface MessageLite.Builderclone in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder setField(Descriptors.FieldDescriptor field, java.lang.Object value)
setField in interface Message.BuildersetField in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder clearField(Descriptors.FieldDescriptor field)
clearField in interface Message.BuilderclearField in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder clearOneof(Descriptors.OneofDescriptor oneof)
clearOneof in interface Message.BuilderclearOneof in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, java.lang.Object value)
setRepeatedField in interface Message.BuildersetRepeatedField in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder addRepeatedField(Descriptors.FieldDescriptor field, java.lang.Object value)
addRepeatedField in interface Message.BuilderaddRepeatedField in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder mergeFrom(Message other)
mergeFrom in interface Message.BuildermergeFrom in class AbstractMessage.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder mergeFrom(StreamingRecognitionResult other)
public final boolean isInitialized()
isInitialized in interface MessageLiteOrBuilderisInitialized in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
mergeFrom in interface Message.BuildermergeFrom in interface MessageLite.BuildermergeFrom in class AbstractMessage.Builder<StreamingRecognitionResult.Builder>java.io.IOExceptionpublic int getMessageTypeValue()
Type of the result message.
.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType message_type = 1;getMessageTypeValue in interface StreamingRecognitionResultOrBuilderpublic StreamingRecognitionResult.Builder setMessageTypeValue(int value)
Type of the result message.
.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType message_type = 1;public StreamingRecognitionResult.MessageType getMessageType()
Type of the result message.
.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType message_type = 1;getMessageType in interface StreamingRecognitionResultOrBuilderpublic StreamingRecognitionResult.Builder setMessageType(StreamingRecognitionResult.MessageType value)
Type of the result message.
.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType message_type = 1;public StreamingRecognitionResult.Builder clearMessageType()
Type of the result message.
.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType message_type = 1;public java.lang.String getTranscript()
Transcript text representing the words that the user spoke. Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
string transcript = 2;getTranscript in interface StreamingRecognitionResultOrBuilderpublic ByteString getTranscriptBytes()
Transcript text representing the words that the user spoke. Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
string transcript = 2;getTranscriptBytes in interface StreamingRecognitionResultOrBuilderpublic StreamingRecognitionResult.Builder setTranscript(java.lang.String value)
Transcript text representing the words that the user spoke. Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
string transcript = 2;public StreamingRecognitionResult.Builder clearTranscript()
Transcript text representing the words that the user spoke. Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
string transcript = 2;public StreamingRecognitionResult.Builder setTranscriptBytes(ByteString value)
Transcript text representing the words that the user spoke. Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
string transcript = 2;public boolean getIsFinal()
The default of 0.0 is a sentinel value indicating `confidence` was not set. If `false`, the `StreamingRecognitionResult` represents an interim result that may change. If `true`, the recognizer will not return any further hypotheses about this piece of the audio. May only be populated for `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
bool is_final = 3;getIsFinal in interface StreamingRecognitionResultOrBuilderpublic StreamingRecognitionResult.Builder setIsFinal(boolean value)
The default of 0.0 is a sentinel value indicating `confidence` was not set. If `false`, the `StreamingRecognitionResult` represents an interim result that may change. If `true`, the recognizer will not return any further hypotheses about this piece of the audio. May only be populated for `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
bool is_final = 3;public StreamingRecognitionResult.Builder clearIsFinal()
The default of 0.0 is a sentinel value indicating `confidence` was not set. If `false`, the `StreamingRecognitionResult` represents an interim result that may change. If `true`, the recognizer will not return any further hypotheses about this piece of the audio. May only be populated for `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
bool is_final = 3;public float getConfidence()
The Speech confidence between 0.0 and 1.0 for the current portion of audio. A higher number indicates an estimated greater likelihood that the recognized words are correct. The default of 0.0 is a sentinel value indicating that confidence was not set. This field is typically only provided if `is_final` is true and you should not rely on it being accurate or even set.
float confidence = 4;getConfidence in interface StreamingRecognitionResultOrBuilderpublic StreamingRecognitionResult.Builder setConfidence(float value)
The Speech confidence between 0.0 and 1.0 for the current portion of audio. A higher number indicates an estimated greater likelihood that the recognized words are correct. The default of 0.0 is a sentinel value indicating that confidence was not set. This field is typically only provided if `is_final` is true and you should not rely on it being accurate or even set.
float confidence = 4;public StreamingRecognitionResult.Builder clearConfidence()
The Speech confidence between 0.0 and 1.0 for the current portion of audio. A higher number indicates an estimated greater likelihood that the recognized words are correct. The default of 0.0 is a sentinel value indicating that confidence was not set. This field is typically only provided if `is_final` is true and you should not rely on it being accurate or even set.
float confidence = 4;public final StreamingRecognitionResult.Builder setUnknownFields(UnknownFieldSet unknownFields)
setUnknownFields in interface Message.BuildersetUnknownFields in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public final StreamingRecognitionResult.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
mergeUnknownFields in interface Message.BuildermergeUnknownFields in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>