# Google Cloud Dialogflow Cx V3 Client - Class StreamingDetectIntentRequest (0.11.1)

0.11.1 (latest) 0.11.0 0.10.2 0.9.2 0.8.1 0.7.2 0.6.0 0.5.2 0.4.1 0.3.4 0.2.1 0.1.1 Reference documentation and code samples for the Google Cloud Dialogflow Cx V3 Client class StreamingDetectIntentRequest.

The top-level message sent by the client to the
[Sessions.StreamingDetectIntent](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Client.SessionsClient#_Google_Cloud_Dialogflow_Cx_V3_Client_SessionsClient__streamingDetectIntent__)
method.

Multiple request messages should be sent in order:

1. The first message must contain [session](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.StreamingDetectIntentRequest#_Google_Cloud_Dialogflow_Cx_V3_StreamingDetectIntentRequest__getSession__), [query_input](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.StreamingDetectIntentRequest#_Google_Cloud_Dialogflow_Cx_V3_StreamingDetectIntentRequest__getQueryInput__) plus optionally [query_params](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.StreamingDetectIntentRequest#_Google_Cloud_Dialogflow_Cx_V3_StreamingDetectIntentRequest__getQueryParams__). If the client wants to receive an audio response, it should also contain [output_audio_config](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.StreamingDetectIntentRequest#_Google_Cloud_Dialogflow_Cx_V3_StreamingDetectIntentRequest__getOutputAudioConfig__).
2. If [query_input](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.StreamingDetectIntentRequest#_Google_Cloud_Dialogflow_Cx_V3_StreamingDetectIntentRequest__getQueryInput__) was set to [query_input.audio.config](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.AudioInput#_Google_Cloud_Dialogflow_Cx_V3_AudioInput__getConfig__), all subsequent messages must contain [query_input.audio.audio](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.AudioInput#_Google_Cloud_Dialogflow_Cx_V3_AudioInput__getAudio__) to continue with Speech recognition. If you decide to rather detect an intent from text input after you already started Speech recognition, please send a message with [query_input.text](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.QueryInput#_Google_Cloud_Dialogflow_Cx_V3_QueryInput__getText__). However, note that:
   - Dialogflow will bill you for the audio duration so far.
   - Dialogflow discards all Speech recognition results in favor of the input text.
   - Dialogflow will use the language code from the first message. After you sent all input, you must half-close or abort the request stream.

Generated from protobuf message `google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest`

## Namespace

Google \\ Cloud \\ Dialogflow \\ Cx \\ V3

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ session` | `string` The name of the session this query is sent to. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/sessions/<SessionID>` or `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/environments/<EnvironmentID>/sessions/<SessionID>`. If `Environment ID` is not specified, we assume default 'draft' environment. It's up to the API caller to choose an appropriate `Session ID`. It can be a random number or some type of session identifiers (preferably hashed). The length of the `Session ID` must not exceed 36 characters. Note: session must be set in the first request. For more information, see the [sessions guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). Note: Always use agent versions for production traffic. See [Versions and environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). |
| `↳ query_params` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.QueryParameters` The parameters of this query. |
| `↳ query_input` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.QueryInput` Required. The input specification. |
| `↳ output_audio_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.OutputAudioConfig` Instructs the speech synthesizer how to generate the output audio. |
| `↳ enable_partial_response` | `bool` Enable partial detect intent response. If this flag is not enabled, response stream still contains only one final `DetectIntentResponse` even if some `Fulfillment`s in the agent have been configured to return partial responses. |
| `↳ enable_debugging_info` | `bool` If true, `StreamingDetectIntentResponse.debugging_info` will get populated. |
| `↳ response_view` | `int` Optional. Specifies which fields in the [QueryResult](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.QueryResult) to return. If not set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. |

### getSession

The name of the session this query is sent to.

Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/sessions/<SessionID>`
or
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/environments/<EnvironmentID>/sessions/<SessionID>`.
If `Environment ID` is not specified, we assume default 'draft'
environment.
It's up to the API caller to choose an appropriate `Session ID`. It can be
a random number or some type of session identifiers (preferably hashed).
The length of the `Session ID` must not exceed 36 characters.
Note: session must be set in the first request.
For more information, see the [sessions
guide](https://cloud.google.com/dialogflow/cx/docs/concept/session).
Note: Always use agent versions for production traffic.
See [Versions and
environments](https://cloud.google.com/dialogflow/cx/docs/concept/version).

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

### setSession

The name of the session this query is sent to.

Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/sessions/<SessionID>`
or
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/environments/<EnvironmentID>/sessions/<SessionID>`.
If `Environment ID` is not specified, we assume default 'draft'
environment.
It's up to the API caller to choose an appropriate `Session ID`. It can be
a random number or some type of session identifiers (preferably hashed).
The length of the `Session ID` must not exceed 36 characters.
Note: session must be set in the first request.
For more information, see the [sessions
guide](https://cloud.google.com/dialogflow/cx/docs/concept/session).
Note: Always use agent versions for production traffic.
See [Versions and
environments](https://cloud.google.com/dialogflow/cx/docs/concept/version).

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

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

### getQueryParams

The parameters of this query.

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

### hasQueryParams

### clearQueryParams

### setQueryParams

The parameters of this query.

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

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

### getQueryInput

Required. The input specification.

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

### hasQueryInput

### clearQueryInput

### setQueryInput

Required. The input specification.

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

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

### getOutputAudioConfig

Instructs the speech synthesizer how to generate the output audio.

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

### hasOutputAudioConfig

### clearOutputAudioConfig

### setOutputAudioConfig

Instructs the speech synthesizer how to generate the output audio.

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

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

### getEnablePartialResponse

Enable partial detect intent response. If this flag is not enabled,
response stream still contains only one final `DetectIntentResponse` even
if some `Fulfillment`s in the agent have been configured to return partial
responses.

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

### setEnablePartialResponse

Enable partial detect intent response. If this flag is not enabled,
response stream still contains only one final `DetectIntentResponse` even
if some `Fulfillment`s in the agent have been configured to return partial
responses.

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

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

### getEnableDebuggingInfo

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

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

### setEnableDebuggingInfo

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

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

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

### getResponseView

Optional. Specifies which fields in the
[QueryResult](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.QueryResult) to return. If not
set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [DetectIntentResponseView](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.DetectIntentResponseView). |

### setResponseView

Optional. Specifies which fields in the
[QueryResult](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.QueryResult) to return. If not
set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [DetectIntentResponseView](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.DetectIntentResponseView). |

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