Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class StreamingAnalyzeContentRequest.
The top-level message sent by the client to the Participants.StreamingAnalyzeContent method.
Multiple request messages should be sent in order:
- The first message must contain participant, config and optionally query_params. If you want to receive an audio response, it should also contain reply_audio_config. The message must not contain input.
- If config in the first message
was set to audio_config,
all subsequent messages must contain
input_audio to continue
with Speech recognition.
However, note that:
- Dialogflow will bill you for the audio so far.
- Dialogflow discards all Speech recognition results in favor of the text input.
- If StreamingAnalyzeContentRequest.config in the first message was set to StreamingAnalyzeContentRequest.text_config, then the second message must contain only input_text. Moreover, you must not send more than two messages. After you sent all input, you must half-close or abort the request stream.
Generated from protobuf message google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest
Methods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ participant |
string
Required. The name of the participant this text comes from. Format: |
↳ audio_config |
Google\Cloud\Dialogflow\V2\InputAudioConfig
Instructs the speech recognizer how to process the speech audio. |
↳ text_config |
Google\Cloud\Dialogflow\V2\InputTextConfig
The natural language text to be processed. |
↳ reply_audio_config |
Google\Cloud\Dialogflow\V2\OutputAudioConfig
Speech synthesis configuration. The speech synthesis settings for a virtual agent that may be configured for the associated conversation profile are not used when calling StreamingAnalyzeContent. If this configuration is not supplied, speech synthesis is disabled. |
↳ input_audio |
string
The input audio content to be recognized. Must be sent if |
↳ input_text |
string
The UTF-8 encoded natural language text to be processed. Must be sent if |
↳ input_dtmf |
Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents
The DTMF digits used to invoke intent and fill in parameter value. This input is ignored if the previous response indicated that DTMF input is not accepted. |
↳ query_params |
Google\Cloud\Dialogflow\V2\QueryParameters
Parameters for a Dialogflow virtual-agent query. |
↳ assist_query_params |
Google\Cloud\Dialogflow\V2\AssistQueryParameters
Parameters for a human assist query. |
↳ cx_parameters |
Google\Protobuf\Struct
Additional parameters to be put into Dialogflow CX session parameters. To remove a parameter from the session, clients should explicitly set the parameter value to null. Note: this field should only be used if you are connecting to a Dialogflow CX agent. |
↳ enable_partial_automated_agent_reply |
bool
Enable partial virtual agent responses. If this flag is not enabled, response stream still contains only one final response even if some |
getParticipant
Required. The name of the participant this text comes from.
Format: projects/<Project ID>/locations/<Location
ID>/conversations/<Conversation ID>/participants/<Participant ID>
.
Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
Returns | |
---|---|
Type | Description |
string |
setParticipant
Required. The name of the participant this text comes from.
Format: projects/<Project ID>/locations/<Location
ID>/conversations/<Conversation ID>/participants/<Participant ID>
.
Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getAudioConfig
Instructs the speech recognizer how to process the speech audio.
Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2;
Returns | |
---|---|
Type | Description |
Google\Cloud\Dialogflow\V2\InputAudioConfig|null |
hasAudioConfig
setAudioConfig
Instructs the speech recognizer how to process the speech audio.
Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Dialogflow\V2\InputAudioConfig
|
Returns | |
---|---|
Type | Description |
$this |
getTextConfig
The natural language text to be processed.
Generated from protobuf field .google.cloud.dialogflow.v2.InputTextConfig text_config = 3;
Returns | |
---|---|
Type | Description |
Google\Cloud\Dialogflow\V2\InputTextConfig|null |
hasTextConfig
setTextConfig
The natural language text to be processed.
Generated from protobuf field .google.cloud.dialogflow.v2.InputTextConfig text_config = 3;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Dialogflow\V2\InputTextConfig
|
Returns | |
---|---|
Type | Description |
$this |
getReplyAudioConfig
Speech synthesis configuration.
The speech synthesis settings for a virtual agent that may be configured for the associated conversation profile are not used when calling StreamingAnalyzeContent. If this configuration is not supplied, speech synthesis is disabled.
Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4;
Returns | |
---|---|
Type | Description |
Google\Cloud\Dialogflow\V2\OutputAudioConfig|null |
hasReplyAudioConfig
clearReplyAudioConfig
setReplyAudioConfig
Speech synthesis configuration.
The speech synthesis settings for a virtual agent that may be configured for the associated conversation profile are not used when calling StreamingAnalyzeContent. If this configuration is not supplied, speech synthesis is disabled.
Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Dialogflow\V2\OutputAudioConfig
|
Returns | |
---|---|
Type | Description |
$this |
getInputAudio
The input audio content to be recognized. Must be sent if audio_config
is set in the first message. The complete audio over all streaming
messages must not exceed 1 minute.
Generated from protobuf field bytes input_audio = 5;
Returns | |
---|---|
Type | Description |
string |
hasInputAudio
setInputAudio
The input audio content to be recognized. Must be sent if audio_config
is set in the first message. The complete audio over all streaming
messages must not exceed 1 minute.
Generated from protobuf field bytes input_audio = 5;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getInputText
The UTF-8 encoded natural language text to be processed. Must be sent if
text_config
is set in the first message. Text length must not exceed
256 bytes for virtual agent interactions. The input_text
field can be
only sent once.
Generated from protobuf field string input_text = 6;
Returns | |
---|---|
Type | Description |
string |
hasInputText
setInputText
The UTF-8 encoded natural language text to be processed. Must be sent if
text_config
is set in the first message. Text length must not exceed
256 bytes for virtual agent interactions. The input_text
field can be
only sent once.
Generated from protobuf field string input_text = 6;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getInputDtmf
The DTMF digits used to invoke intent and fill in parameter value.
This input is ignored if the previous response indicated that DTMF input is not accepted.
Generated from protobuf field .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9;
Returns | |
---|---|
Type | Description |
Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents|null |
hasInputDtmf
setInputDtmf
The DTMF digits used to invoke intent and fill in parameter value.
This input is ignored if the previous response indicated that DTMF input is not accepted.
Generated from protobuf field .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents
|
Returns | |
---|---|
Type | Description |
$this |
getQueryParams
Parameters for a Dialogflow virtual-agent query.
Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 7;
Returns | |
---|---|
Type | Description |
Google\Cloud\Dialogflow\V2\QueryParameters|null |
hasQueryParams
clearQueryParams
setQueryParams
Parameters for a Dialogflow virtual-agent query.
Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 7;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Dialogflow\V2\QueryParameters
|
Returns | |
---|---|
Type | Description |
$this |
getAssistQueryParams
Parameters for a human assist query.
Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8;
Returns | |
---|---|
Type | Description |
Google\Cloud\Dialogflow\V2\AssistQueryParameters|null |
hasAssistQueryParams
clearAssistQueryParams
setAssistQueryParams
Parameters for a human assist query.
Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Dialogflow\V2\AssistQueryParameters
|
Returns | |
---|---|
Type | Description |
$this |
getCxParameters
Additional parameters to be put into Dialogflow CX session parameters. To remove a parameter from the session, clients should explicitly set the parameter value to null.
Note: this field should only be used if you are connecting to a Dialogflow CX agent.
Generated from protobuf field .google.protobuf.Struct cx_parameters = 13;
Returns | |
---|---|
Type | Description |
Google\Protobuf\Struct|null |
hasCxParameters
clearCxParameters
setCxParameters
Additional parameters to be put into Dialogflow CX session parameters. To remove a parameter from the session, clients should explicitly set the parameter value to null.
Note: this field should only be used if you are connecting to a Dialogflow CX agent.
Generated from protobuf field .google.protobuf.Struct cx_parameters = 13;
Parameter | |
---|---|
Name | Description |
var |
Google\Protobuf\Struct
|
Returns | |
---|---|
Type | Description |
$this |
getEnablePartialAutomatedAgentReply
Enable partial virtual agent responses. If this flag is not enabled,
response stream still contains only one final response even if some
Fulfillment
s in Dialogflow virtual agent have been configured to return
partial responses.
Generated from protobuf field bool enable_partial_automated_agent_reply = 12;
Returns | |
---|---|
Type | Description |
bool |
setEnablePartialAutomatedAgentReply
Enable partial virtual agent responses. If this flag is not enabled,
response stream still contains only one final response even if some
Fulfillment
s in Dialogflow virtual agent have been configured to return
partial responses.
Generated from protobuf field bool enable_partial_automated_agent_reply = 12;
Parameter | |
---|---|
Name | Description |
var |
bool
|
Returns | |
---|---|
Type | Description |
$this |
getConfig
Returns | |
---|---|
Type | Description |
string |
getInput
Returns | |
---|---|
Type | Description |
string |