Google Cloud Dialogflow V2 Client - Class StreamingAnalyzeContentResponse (1.0.1)

Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class StreamingAnalyzeContentResponse.

The top-level message returned from the StreamingAnalyzeContent method.

Multiple response messages can be returned in order:

  1. If the input was set to streaming audio, the first one or more messages contain recognition_result. Each recognition_result represents a more complete transcript of what the user said. The last recognition_result has is_final set to true.
  2. In virtual agent stage: if enable_partial_automated_agent_reply is true, the following N (currently 1 <= N <= 4) messages contain automated_agent_reply and optionally reply_audio returned by the virtual agent. The first (N-1) automated_agent_replys will have automated_agent_reply_type set to PARTIAL. The last automated_agent_reply has automated_agent_reply_type set to FINAL. If enable_partial_automated_agent_reply is not enabled, response stream only contains the final reply. In human assist stage: the following N (N >= 1) messages contain human_agent_suggestion_results, end_user_suggestion_results or message.

Generated from protobuf message google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ recognition_result Google\Cloud\Dialogflow\V2\StreamingRecognitionResult

The result of speech recognition.

↳ reply_text string

The output text content. This field is set if an automated agent responded with a text for the user.

↳ reply_audio Google\Cloud\Dialogflow\V2\OutputAudio

The audio data bytes encoded as specified in the request. This field is set if: - The reply_audio_config field is specified in the request. - The automated agent, which this output comes from, responded with audio. In such case, the reply_audio.config field contains settings used to synthesize the speech. In some scenarios, multiple output audio fields may be present in the response structure. In these cases, only the top-most-level audio output has content.

↳ automated_agent_reply Google\Cloud\Dialogflow\V2\AutomatedAgentReply

Only set if a Dialogflow automated agent has responded. Note that: AutomatedAgentReply.detect_intent_response.output_audio and AutomatedAgentReply.detect_intent_response.output_audio_config are always empty, use reply_audio instead.

↳ message Google\Cloud\Dialogflow\V2\Message

Message analyzed by CCAI.

↳ human_agent_suggestion_results array<Google\Cloud\Dialogflow\V2\SuggestionResult>

The suggestions for most recent human agent. The order is the same as HumanAgentAssistantConfig.SuggestionConfig.feature_configs of HumanAgentAssistantConfig.human_agent_suggestion_config.

↳ end_user_suggestion_results array<Google\Cloud\Dialogflow\V2\SuggestionResult>

The suggestions for end user. The order is the same as HumanAgentAssistantConfig.SuggestionConfig.feature_configs of HumanAgentAssistantConfig.end_user_suggestion_config.

↳ dtmf_parameters Google\Cloud\Dialogflow\V2\DtmfParameters

Indicates the parameters of DTMF.

getRecognitionResult

The result of speech recognition.

Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1;

Returns
TypeDescription
Google\Cloud\Dialogflow\V2\StreamingRecognitionResult|null

hasRecognitionResult

clearRecognitionResult

setRecognitionResult

The result of speech recognition.

Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1;

Parameter
NameDescription
var Google\Cloud\Dialogflow\V2\StreamingRecognitionResult
Returns
TypeDescription
$this

getReplyText

The output text content.

This field is set if an automated agent responded with a text for the user.

Generated from protobuf field string reply_text = 2;

Returns
TypeDescription
string

setReplyText

The output text content.

This field is set if an automated agent responded with a text for the user.

Generated from protobuf field string reply_text = 2;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getReplyAudio

The audio data bytes encoded as specified in the request.

This field is set if:

  • The reply_audio_config field is specified in the request.
  • The automated agent, which this output comes from, responded with audio. In such case, the reply_audio.config field contains settings used to synthesize the speech. In some scenarios, multiple output audio fields may be present in the response structure. In these cases, only the top-most-level audio output has content.

Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3;

Returns
TypeDescription
Google\Cloud\Dialogflow\V2\OutputAudio|null

hasReplyAudio

clearReplyAudio

setReplyAudio

The audio data bytes encoded as specified in the request.

This field is set if:

  • The reply_audio_config field is specified in the request.
  • The automated agent, which this output comes from, responded with audio. In such case, the reply_audio.config field contains settings used to synthesize the speech. In some scenarios, multiple output audio fields may be present in the response structure. In these cases, only the top-most-level audio output has content.

Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3;

Parameter
NameDescription
var Google\Cloud\Dialogflow\V2\OutputAudio
Returns
TypeDescription
$this

getAutomatedAgentReply

Only set if a Dialogflow automated agent has responded.

Note that: AutomatedAgentReply.detect_intent_response.output_audio and AutomatedAgentReply.detect_intent_response.output_audio_config are always empty, use reply_audio instead.

Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4;

Returns
TypeDescription
Google\Cloud\Dialogflow\V2\AutomatedAgentReply|null

hasAutomatedAgentReply

clearAutomatedAgentReply

setAutomatedAgentReply

Only set if a Dialogflow automated agent has responded.

Note that: AutomatedAgentReply.detect_intent_response.output_audio and AutomatedAgentReply.detect_intent_response.output_audio_config are always empty, use reply_audio instead.

Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4;

Parameter
NameDescription
var Google\Cloud\Dialogflow\V2\AutomatedAgentReply
Returns
TypeDescription
$this

getMessage

Message analyzed by CCAI.

Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 6;

Returns
TypeDescription
Google\Cloud\Dialogflow\V2\Message|null

hasMessage

clearMessage

setMessage

Message analyzed by CCAI.

Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 6;

Parameter
NameDescription
var Google\Cloud\Dialogflow\V2\Message
Returns
TypeDescription
$this

getHumanAgentSuggestionResults

The suggestions for most recent human agent. The order is the same as HumanAgentAssistantConfig.SuggestionConfig.feature_configs of HumanAgentAssistantConfig.human_agent_suggestion_config.

Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7;

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setHumanAgentSuggestionResults

The suggestions for most recent human agent. The order is the same as HumanAgentAssistantConfig.SuggestionConfig.feature_configs of HumanAgentAssistantConfig.human_agent_suggestion_config.

Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7;

Parameter
NameDescription
var array<Google\Cloud\Dialogflow\V2\SuggestionResult>
Returns
TypeDescription
$this

getEndUserSuggestionResults

The suggestions for end user. The order is the same as HumanAgentAssistantConfig.SuggestionConfig.feature_configs of HumanAgentAssistantConfig.end_user_suggestion_config.

Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8;

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setEndUserSuggestionResults

The suggestions for end user. The order is the same as HumanAgentAssistantConfig.SuggestionConfig.feature_configs of HumanAgentAssistantConfig.end_user_suggestion_config.

Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8;

Parameter
NameDescription
var array<Google\Cloud\Dialogflow\V2\SuggestionResult>
Returns
TypeDescription
$this

getDtmfParameters

Indicates the parameters of DTMF.

Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10;

Returns
TypeDescription
Google\Cloud\Dialogflow\V2\DtmfParameters|null

hasDtmfParameters

clearDtmfParameters

setDtmfParameters

Indicates the parameters of DTMF.

Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10;

Parameter
NameDescription
var Google\Cloud\Dialogflow\V2\DtmfParameters
Returns
TypeDescription
$this