# Google Cloud Dialogflow V2 Client - Class StreamingAnalyzeContentRequest (2.4.0)

2.4.0 (latest) 2.3.1 2.2.1 2.1.2 2.0.1 1.17.2 1.16.0 1.15.1 1.14.0 1.13.0 1.12.3 1.11.0 1.10.2 1.9.0 1.8.0 1.7.2 1.6.0 1.5.0 1.4.0 1.3.2 1.2.0 1.1.1 1.0.1 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](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Client.ParticipantsClient#_Google_Cloud_Dialogflow_V2_Client_ParticipantsClient__streamingAnalyzeContent__)
method.

Multiple request messages should be sent in order:

1. The first message must contain [participant](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.StreamingAnalyzeContentRequest#_Google_Cloud_Dialogflow_V2_StreamingAnalyzeContentRequest__getParticipant__), [config](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.StreamingAnalyzeContentRequest#_Google_Cloud_Dialogflow_V2_StreamingAnalyzeContentRequest__getConfig__) and optionally [query_params](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.StreamingAnalyzeContentRequest#_Google_Cloud_Dialogflow_V2_StreamingAnalyzeContentRequest__getQueryParams__). If you want to receive an audio response, it should also contain [reply_audio_config](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.StreamingAnalyzeContentRequest#_Google_Cloud_Dialogflow_V2_StreamingAnalyzeContentRequest__getReplyAudioConfig__). The message must not contain [input](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.StreamingAnalyzeContentRequest#_Google_Cloud_Dialogflow_V2_StreamingAnalyzeContentRequest__getInput__).
2. If [config](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.StreamingAnalyzeContentRequest#_Google_Cloud_Dialogflow_V2_StreamingAnalyzeContentRequest__getConfig__) in the first message was set to [audio_config](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.StreamingAnalyzeContentRequest#_Google_Cloud_Dialogflow_V2_StreamingAnalyzeContentRequest__getAudioConfig__), all subsequent messages must contain [input_audio](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.StreamingAnalyzeContentRequest#_Google_Cloud_Dialogflow_V2_StreamingAnalyzeContentRequest__getInputAudio__) 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](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.StreamingAnalyzeContentRequest#_Google_Cloud_Dialogflow_V2_StreamingAnalyzeContentRequest__getConfig__) in the first message was set to [StreamingAnalyzeContentRequest.text_config](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.StreamingAnalyzeContentRequest#_Google_Cloud_Dialogflow_V2_StreamingAnalyzeContentRequest__getTextConfig__), then the second message must contain only [input_text](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.StreamingAnalyzeContentRequest#_Google_Cloud_Dialogflow_V2_StreamingAnalyzeContentRequest__getInputText__). 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`

## Namespace

Google \\ Cloud \\ Dialogflow \\ V2

## 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: `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation ID>/participants/<Participant ID>`. |
| `↳ audio_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.InputAudioConfig` Instructs the speech recognizer how to process the speech audio. |
| `↳ text_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.InputTextConfig` The natural language text to be processed. |
| `↳ reply_audio_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/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 `audio_config` is set in the first message. The complete audio over all streaming messages must not exceed 1 minute. |
| `↳ input_text` | `string` 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, and would cancel the speech recognition if any ongoing. |
| `↳ input_dtmf` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/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` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.QueryParameters` Parameters for a Dialogflow virtual-agent query. |
| `↳ assist_query_params` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.AssistQueryParameters` Parameters for a human assist query. |
| `↳ cx_parameters` | `https://protobuf.dev/reference/php/api-docs/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_extended_streaming` | `bool` Optional. Enable full bidirectional streaming. You can keep streaming the audio until timeout, and there's no need to half close the stream to get the response. Restrictions: - Timeout: 3 mins. - Audio Encoding: only supports [AudioEncoding.AUDIO_ENCODING_LINEAR_16](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.AudioEncoding#_Google_Cloud_Dialogflow_V2_AudioEncoding__AUDIO_ENCODING_LINEAR_16) and [AudioEncoding.AUDIO_ENCODING_MULAW](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.AudioEncoding#_Google_Cloud_Dialogflow_V2_AudioEncoding__AUDIO_ENCODING_MULAW) - Lifecycle: conversation should be in `Assist Stage`, go to [Conversations.CreateConversation](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Client.ConversationsClient#_Google_Cloud_Dialogflow_V2_Client_ConversationsClient__createConversation__) for more information. InvalidArgument Error will be returned if the one of restriction checks failed. You can find more details in <https://cloud.google.com/agent-assist/docs/extended-streaming> |
| `↳ enable_partial_automated_agent_reply` | `bool` Optional. Enable partial responses from Dialogflow CX agent. If this flag is not enabled, response stream still contains only one final response even if some `Fulfillment`s in Dialogflow CX agent have been configured to return partial responses. |
| `↳ output_multiple_utterances` | `bool` Optional. If multiple uttereances are detected in the audio stream, process them individually instead of stitching them together to form a single utterance. |
| `↳ enable_debugging_info` | `bool` If true, `StreamingAnalyzeContentResponse.debugging_info` will get populated. |

### getParticipant

Required. The name of the participant this text comes from.

Format: `projects/<Project ID>/locations/<Location
ID>/conversations/<Conversation ID>/participants/<Participant ID>`.

| **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>`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAudioConfig

Instructs the speech recognizer how to process the speech audio.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.InputAudioConfig|null` |   |

### hasAudioConfig

### setAudioConfig

Instructs the speech recognizer how to process the speech audio.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.InputAudioConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTextConfig

The natural language text to be processed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.InputTextConfig|null` |   |

### hasTextConfig

### setTextConfig

The natural language text to be processed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/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.

| **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.

| **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, and would cancel the speech recognition if any ongoing.

| **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, and would cancel the speech recognition if any ongoing.

| **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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.TelephonyDtmfEvents` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getQueryParams

Parameters for a Dialogflow virtual-agent query.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.QueryParameters|null` |   |

### hasQueryParams

### clearQueryParams

### setQueryParams

Parameters for a Dialogflow virtual-agent query.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.QueryParameters` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAssistQueryParams

Parameters for a human assist query.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.AssistQueryParameters|null` |   |

### hasAssistQueryParams

### clearAssistQueryParams

### setAssistQueryParams

Parameters for a human assist query.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEnableExtendedStreaming

Optional. Enable full bidirectional streaming. You can keep streaming the
audio until timeout, and there's no need to half close the stream to get
the response.

Restrictions:

- Timeout: 3 mins.
- Audio Encoding: only supports [AudioEncoding.AUDIO_ENCODING_LINEAR_16](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.AudioEncoding#_Google_Cloud_Dialogflow_V2_AudioEncoding__AUDIO_ENCODING_LINEAR_16) and [AudioEncoding.AUDIO_ENCODING_MULAW](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.AudioEncoding#_Google_Cloud_Dialogflow_V2_AudioEncoding__AUDIO_ENCODING_MULAW)
- Lifecycle: conversation should be in `Assist Stage`, go to [Conversations.CreateConversation](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Client.ConversationsClient#_Google_Cloud_Dialogflow_V2_Client_ConversationsClient__createConversation__) for more information. InvalidArgument Error will be returned if the one of restriction checks failed. You can find more details in <https://cloud.google.com/agent-assist/docs/extended-streaming>

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setEnableExtendedStreaming

Optional. Enable full bidirectional streaming. You can keep streaming the
audio until timeout, and there's no need to half close the stream to get
the response.

Restrictions:

- Timeout: 3 mins.
- Audio Encoding: only supports [AudioEncoding.AUDIO_ENCODING_LINEAR_16](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.AudioEncoding#_Google_Cloud_Dialogflow_V2_AudioEncoding__AUDIO_ENCODING_LINEAR_16) and [AudioEncoding.AUDIO_ENCODING_MULAW](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.AudioEncoding#_Google_Cloud_Dialogflow_V2_AudioEncoding__AUDIO_ENCODING_MULAW)
- Lifecycle: conversation should be in `Assist Stage`, go to [Conversations.CreateConversation](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Client.ConversationsClient#_Google_Cloud_Dialogflow_V2_Client_ConversationsClient__createConversation__) for more information. InvalidArgument Error will be returned if the one of restriction checks failed. You can find more details in <https://cloud.google.com/agent-assist/docs/extended-streaming>

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEnablePartialAutomatedAgentReply

Optional. Enable partial responses from Dialogflow CX agent. If this flag
is not enabled, response stream still contains only one final response even
if some `Fulfillment`s in Dialogflow CX agent have been configured to
return partial responses.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setEnablePartialAutomatedAgentReply

Optional. Enable partial responses from Dialogflow CX agent. If this flag
is not enabled, response stream still contains only one final response even
if some `Fulfillment`s in Dialogflow CX agent have been configured to
return partial responses.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getOutputMultipleUtterances

Optional. If multiple uttereances are detected in the audio stream, process
them individually instead of stitching them together to form a single
utterance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setOutputMultipleUtterances

Optional. If multiple uttereances are detected in the audio stream, process
them individually instead of stitching them together to form a single
utterance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEnableDebuggingInfo

If true, `StreamingAnalyzeContentResponse.debugging_info` will get
populated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setEnableDebuggingInfo

If true, `StreamingAnalyzeContentResponse.debugging_info` will get
populated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getConfig

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### getInput

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |