google.cloud.dialogflow.v2.StreamingRecognitionResult
*/
class StreamingRecognitionResult extends \Google\Protobuf\Internal\Message
{
/**
* Type of the result message.
*
* Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType message_type = 1;
*/
private $message_type = 0;
/**
* Transcript text representing the words that the user spoke.
* Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
*
* Generated from protobuf field string transcript = 2;
*/
private $transcript = '';
/**
* 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`.
*
* Generated from protobuf field bool is_final = 3;
*/
private $is_final = false;
/**
* 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.
*
* Generated from protobuf field float confidence = 4;
*/
private $confidence = 0.0;
public function __construct() {
\GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce();
parent::__construct();
}
/**
* Type of the result message.
*
* Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType message_type = 1;
* @return int
*/
public function getMessageType()
{
return $this->message_type;
}
/**
* Type of the result message.
*
* Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType message_type = 1;
* @param int $var
* @return $this
*/
public function setMessageType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult_MessageType::class);
$this->message_type = $var;
return $this;
}
/**
* Transcript text representing the words that the user spoke.
* Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
*
* Generated from protobuf field string transcript = 2;
* @return string
*/
public function getTranscript()
{
return $this->transcript;
}
/**
* Transcript text representing the words that the user spoke.
* Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
*
* Generated from protobuf field string transcript = 2;
* @param string $var
* @return $this
*/
public function setTranscript($var)
{
GPBUtil::checkString($var, True);
$this->transcript = $var;
return $this;
}
/**
* 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`.
*
* Generated from protobuf field bool is_final = 3;
* @return bool
*/
public function getIsFinal()
{
return $this->is_final;
}
/**
* 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`.
*
* Generated from protobuf field bool is_final = 3;
* @param bool $var
* @return $this
*/
public function setIsFinal($var)
{
GPBUtil::checkBool($var);
$this->is_final = $var;
return $this;
}
/**
* 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.
*
* Generated from protobuf field float confidence = 4;
* @return float
*/
public function getConfidence()
{
return $this->confidence;
}
/**
* 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.
*
* Generated from protobuf field float confidence = 4;
* @param float $var
* @return $this
*/
public function setConfidence($var)
{
GPBUtil::checkFloat($var);
$this->confidence = $var;
return $this;
}
}