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.v2.StreamingRecognitionResult
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, addAll, mergeFrom, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
mergeFrom
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>
public StreamingRecognitionResult.Builder clear()
clear
in interface Message.Builder
clear
in interface MessageLite.Builder
clear
in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>
public Descriptors.Descriptor getDescriptorForType()
getDescriptorForType
in interface Message.Builder
getDescriptorForType
in interface MessageOrBuilder
getDescriptorForType
in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>
public StreamingRecognitionResult getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
public StreamingRecognitionResult build()
build
in interface Message.Builder
build
in interface MessageLite.Builder
public StreamingRecognitionResult buildPartial()
buildPartial
in interface Message.Builder
buildPartial
in interface MessageLite.Builder
public StreamingRecognitionResult.Builder clone()
clone
in interface Message.Builder
clone
in interface MessageLite.Builder
clone
in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>
public StreamingRecognitionResult.Builder setField(Descriptors.FieldDescriptor field, java.lang.Object value)
setField
in interface Message.Builder
setField
in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>
public StreamingRecognitionResult.Builder clearField(Descriptors.FieldDescriptor field)
clearField
in interface Message.Builder
clearField
in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>
public StreamingRecognitionResult.Builder clearOneof(Descriptors.OneofDescriptor oneof)
clearOneof
in interface Message.Builder
clearOneof
in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>
public StreamingRecognitionResult.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, java.lang.Object value)
setRepeatedField
in interface Message.Builder
setRepeatedField
in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>
public StreamingRecognitionResult.Builder addRepeatedField(Descriptors.FieldDescriptor field, java.lang.Object value)
addRepeatedField
in interface Message.Builder
addRepeatedField
in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>
public StreamingRecognitionResult.Builder mergeFrom(Message other)
mergeFrom
in interface Message.Builder
mergeFrom
in class AbstractMessage.Builder<StreamingRecognitionResult.Builder>
public StreamingRecognitionResult.Builder mergeFrom(StreamingRecognitionResult other)
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>
public StreamingRecognitionResult.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
mergeFrom
in interface Message.Builder
mergeFrom
in interface MessageLite.Builder
mergeFrom
in class AbstractMessage.Builder<StreamingRecognitionResult.Builder>
java.io.IOException
public int getMessageTypeValue()
Type of the result message.
.google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType message_type = 1;
getMessageTypeValue
in interface StreamingRecognitionResultOrBuilder
public StreamingRecognitionResult.Builder setMessageTypeValue(int value)
Type of the result message.
.google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType message_type = 1;
public StreamingRecognitionResult.MessageType getMessageType()
Type of the result message.
.google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType message_type = 1;
getMessageType
in interface StreamingRecognitionResultOrBuilder
public StreamingRecognitionResult.Builder setMessageType(StreamingRecognitionResult.MessageType value)
Type of the result message.
.google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType message_type = 1;
public StreamingRecognitionResult.Builder clearMessageType()
Type of the result message.
.google.cloud.dialogflow.v2.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 StreamingRecognitionResultOrBuilder
public 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 StreamingRecognitionResultOrBuilder
public 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 StreamingRecognitionResultOrBuilder
public 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 StreamingRecognitionResultOrBuilder
public 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.Builder
setUnknownFields
in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>
public final StreamingRecognitionResult.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
mergeUnknownFields
in interface Message.Builder
mergeUnknownFields
in class GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>