# Google Cloud Dialogflow Cx V3 Client - Class ResponseMessage (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 ResponseMessage.

Represents a response message that can be returned by a conversational agent.

Response messages are also used for output audio synthesis. The approach is
as follows:

- If at least one OutputAudioText response is present, then all OutputAudioText responses are linearly concatenated, and the result is used for output audio synthesis.
- If the OutputAudioText responses are a mixture of text and SSML, then the concatenated result is treated as SSML; otherwise, the result is treated as either text or SSML as appropriate. The agent designer should ideally use either text or SSML consistently throughout the bot design.
- Otherwise, all Text responses are linearly concatenated, and the result is used for output audio synthesis. This approach allows for more sophisticated user experience scenarios, where the text displayed to the user may differ from what is heard.

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

## Namespace

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

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ text` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage.Text` Returns a text response. |
| `↳ payload` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct` Returns a response containing a custom, platform-specific payload. |
| `↳ conversation_success` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage.ConversationSuccess` Indicates that the conversation succeeded. |
| `↳ output_audio_text` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage.OutputAudioText` A text or ssml response that is preferentially used for TTS output audio synthesis, as described in the comment on the ResponseMessage message. |
| `↳ live_agent_handoff` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage.LiveAgentHandoff` Hands off conversation to a human agent. |
| `↳ end_interaction` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage.EndInteraction` Output only. A signal that indicates the interaction with the Dialogflow agent has ended. This message is generated by Dialogflow only when the conversation reaches `END_SESSION` page. It is not supposed to be defined by the user. It's guaranteed that there is at most one such message in each response. |
| `↳ play_audio` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage.PlayAudio` Signal that the client should play an audio clip hosted at a client-specific URI. Dialogflow uses this to construct [mixed_audio](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage#_Google_Cloud_Dialogflow_Cx_V3_ResponseMessage__getMixedAudio__). However, Dialogflow itself does not try to read or process the URI in any way. |
| `↳ mixed_audio` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage.MixedAudio` Output only. An audio response message composed of both the synthesized Dialogflow agent responses and responses defined via [play_audio](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage#_Google_Cloud_Dialogflow_Cx_V3_ResponseMessage__getPlayAudio__). This message is generated by Dialogflow only and not supposed to be defined by the user. |
| `↳ telephony_transfer_call` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage.TelephonyTransferCall` A signal that the client should transfer the phone call connected to this agent to a third-party endpoint. |
| `↳ knowledge_info_card` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage.KnowledgeInfoCard` Represents info card for knowledge answers, to be better rendered in Dialogflow Messenger. |
| `↳ tool_call` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ToolCall` Returns the definition of a tool call that should be executed by the client. |
| `↳ response_type` | `int` Response type. |
| `↳ channel` | `string` The channel which the response is associated with. Clients can specify the channel via [QueryParameters.channel](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.QueryParameters#_Google_Cloud_Dialogflow_Cx_V3_QueryParameters__getChannel__), and only associated channel response will be returned. |

### getText

Returns a text response.

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

### hasText

### setText

Returns a text response.

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

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

### getPayload

Returns a response containing a custom, platform-specific payload.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct|null` |   |

### hasPayload

### setPayload

Returns a response containing a custom, platform-specific payload.

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

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

### getConversationSuccess

Indicates that the conversation succeeded.

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

### hasConversationSuccess

### setConversationSuccess

Indicates that the conversation succeeded.

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

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

### getOutputAudioText

A text or ssml response that is preferentially used for TTS output audio
synthesis, as described in the comment on the ResponseMessage message.

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

### hasOutputAudioText

### setOutputAudioText

A text or ssml response that is preferentially used for TTS output audio
synthesis, as described in the comment on the ResponseMessage message.

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

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

### getLiveAgentHandoff

Hands off conversation to a human agent.

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

### hasLiveAgentHandoff

### setLiveAgentHandoff

Hands off conversation to a human agent.

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

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

### getEndInteraction

Output only. A signal that indicates the interaction with the Dialogflow
agent has ended. This message is generated by Dialogflow only when the
conversation reaches `END_SESSION` page. It is not supposed to be defined
by the user.

It's guaranteed that there is at most one such message in each response.

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

### hasEndInteraction

### setEndInteraction

Output only. A signal that indicates the interaction with the Dialogflow
agent has ended. This message is generated by Dialogflow only when the
conversation reaches `END_SESSION` page. It is not supposed to be defined
by the user.

It's guaranteed that there is at most one such message in each response.

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

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

### getPlayAudio

Signal that the client should play an audio clip hosted at a
client-specific URI. Dialogflow uses this to construct
[mixed_audio](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage#_Google_Cloud_Dialogflow_Cx_V3_ResponseMessage__getMixedAudio__).

However, Dialogflow itself does not try to read or process the URI in any
way.

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

### hasPlayAudio

### setPlayAudio

Signal that the client should play an audio clip hosted at a
client-specific URI. Dialogflow uses this to construct
[mixed_audio](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage#_Google_Cloud_Dialogflow_Cx_V3_ResponseMessage__getMixedAudio__).

However, Dialogflow itself does not try to read or process the URI in any
way.

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

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

### getMixedAudio

Output only. An audio response message composed of both the synthesized
Dialogflow agent responses and responses defined via
[play_audio](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage#_Google_Cloud_Dialogflow_Cx_V3_ResponseMessage__getPlayAudio__).

This message is generated by Dialogflow only and not supposed to be
defined by the user.

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

### hasMixedAudio

### setMixedAudio

Output only. An audio response message composed of both the synthesized
Dialogflow agent responses and responses defined via
[play_audio](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage#_Google_Cloud_Dialogflow_Cx_V3_ResponseMessage__getPlayAudio__).

This message is generated by Dialogflow only and not supposed to be
defined by the user.

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

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

### getTelephonyTransferCall

A signal that the client should transfer the phone call connected to
this agent to a third-party endpoint.

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

### hasTelephonyTransferCall

### setTelephonyTransferCall

A signal that the client should transfer the phone call connected to
this agent to a third-party endpoint.

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

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

### getKnowledgeInfoCard

Represents info card for knowledge answers, to be better rendered in
Dialogflow Messenger.

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

### hasKnowledgeInfoCard

### setKnowledgeInfoCard

Represents info card for knowledge answers, to be better rendered in
Dialogflow Messenger.

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

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

### getToolCall

Returns the definition of a tool call that should be executed by the
client.

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

### hasToolCall

### setToolCall

Returns the definition of a tool call that should be executed by the
client.

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

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

### getResponseType

Response type.

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

### setResponseType

Response type.

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

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

### getChannel

The channel which the response is associated with. Clients can specify the
channel via
[QueryParameters.channel](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.QueryParameters#_Google_Cloud_Dialogflow_Cx_V3_QueryParameters__getChannel__),
and only associated channel response will be returned.

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

### setChannel

The channel which the response is associated with. Clients can specify the
channel via
[QueryParameters.channel](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.QueryParameters#_Google_Cloud_Dialogflow_Cx_V3_QueryParameters__getChannel__),
and only associated channel response will be returned.

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

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

### getMessage

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