Dialogflow CX V3 API - Class Google::Cloud::Dialogflow::CX::V3::ResponseMessage (v1.4.0)

Reference documentation and code samples for the Dialogflow CX V3 API class Google::Cloud::Dialogflow::CX::V3::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.

Inherits

  • Object

Extended By

  • Google::Protobuf::MessageExts::ClassMethods

Includes

  • Google::Protobuf::MessageExts

Methods

#channel

def channel() -> ::String
Returns
  • (::String) — The channel which the response is associated with. Clients can specify the channel via QueryParameters.channel, and only associated channel response will be returned.

#channel=

def channel=(value) -> ::String
Parameter
  • value (::String) — The channel which the response is associated with. Clients can specify the channel via QueryParameters.channel, and only associated channel response will be returned.
Returns
  • (::String) — The channel which the response is associated with. Clients can specify the channel via QueryParameters.channel, and only associated channel response will be returned.

#conversation_success

def conversation_success() -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ConversationSuccess
Returns
  • (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ConversationSuccess) — Indicates that the conversation succeeded.

    Note: The following fields are mutually exclusive: conversation_success, text, payload, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#conversation_success=

def conversation_success=(value) -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ConversationSuccess
Parameter
  • value (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ConversationSuccess) — Indicates that the conversation succeeded.

    Note: The following fields are mutually exclusive: conversation_success, text, payload, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ConversationSuccess) — Indicates that the conversation succeeded.

    Note: The following fields are mutually exclusive: conversation_success, text, payload, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#end_interaction

def end_interaction() -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::EndInteraction
Returns
  • (::Google::Cloud::Dialogflow::CX::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.

    Note: The following fields are mutually exclusive: end_interaction, text, payload, conversation_success, output_audio_text, live_agent_handoff, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#knowledge_info_card

def knowledge_info_card() -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::KnowledgeInfoCard
Returns
  • (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::KnowledgeInfoCard) — Represents info card for knowledge answers, to be better rendered in Dialogflow Messenger.

    Note: The following fields are mutually exclusive: knowledge_info_card, text, payload, conversation_success, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call. If a field in that set is populated, all other fields in the set will automatically be cleared.

#knowledge_info_card=

def knowledge_info_card=(value) -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::KnowledgeInfoCard
Parameter
  • value (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::KnowledgeInfoCard) — Represents info card for knowledge answers, to be better rendered in Dialogflow Messenger.

    Note: The following fields are mutually exclusive: knowledge_info_card, text, payload, conversation_success, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::KnowledgeInfoCard) — Represents info card for knowledge answers, to be better rendered in Dialogflow Messenger.

    Note: The following fields are mutually exclusive: knowledge_info_card, text, payload, conversation_success, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call. If a field in that set is populated, all other fields in the set will automatically be cleared.

#live_agent_handoff

def live_agent_handoff() -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::LiveAgentHandoff
Returns
  • (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::LiveAgentHandoff) — Hands off conversation to a human agent.

    Note: The following fields are mutually exclusive: live_agent_handoff, text, payload, conversation_success, output_audio_text, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#live_agent_handoff=

def live_agent_handoff=(value) -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::LiveAgentHandoff
Parameter
  • value (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::LiveAgentHandoff) — Hands off conversation to a human agent.

    Note: The following fields are mutually exclusive: live_agent_handoff, text, payload, conversation_success, output_audio_text, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::LiveAgentHandoff) — Hands off conversation to a human agent.

    Note: The following fields are mutually exclusive: live_agent_handoff, text, payload, conversation_success, output_audio_text, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#mixed_audio

def mixed_audio() -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::MixedAudio
Returns
  • (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::MixedAudio) — Output only. An audio response message composed of both the synthesized Dialogflow agent responses and responses defined via play_audio. This message is generated by Dialogflow only and not supposed to be defined by the user.

    Note: The following fields are mutually exclusive: mixed_audio, text, payload, conversation_success, output_audio_text, live_agent_handoff, end_interaction, play_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#output_audio_text

def output_audio_text() -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::OutputAudioText
Returns
  • (::Google::Cloud::Dialogflow::CX::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.

    Note: The following fields are mutually exclusive: output_audio_text, text, payload, conversation_success, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#output_audio_text=

def output_audio_text=(value) -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::OutputAudioText
Parameter
  • value (::Google::Cloud::Dialogflow::CX::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.

    Note: The following fields are mutually exclusive: output_audio_text, text, payload, conversation_success, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Dialogflow::CX::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.

    Note: The following fields are mutually exclusive: output_audio_text, text, payload, conversation_success, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#payload

def payload() -> ::Google::Protobuf::Struct
Returns
  • (::Google::Protobuf::Struct) — Returns a response containing a custom, platform-specific payload.

    Note: The following fields are mutually exclusive: payload, text, conversation_success, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#payload=

def payload=(value) -> ::Google::Protobuf::Struct
Parameter
  • value (::Google::Protobuf::Struct) — Returns a response containing a custom, platform-specific payload.

    Note: The following fields are mutually exclusive: payload, text, conversation_success, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Protobuf::Struct) — Returns a response containing a custom, platform-specific payload.

    Note: The following fields are mutually exclusive: payload, text, conversation_success, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#play_audio

def play_audio() -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::PlayAudio
Returns
  • (::Google::Cloud::Dialogflow::CX::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. However, Dialogflow itself does not try to read or process the URI in any way.

    Note: The following fields are mutually exclusive: play_audio, text, payload, conversation_success, output_audio_text, live_agent_handoff, end_interaction, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#play_audio=

def play_audio=(value) -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::PlayAudio
Parameter
  • value (::Google::Cloud::Dialogflow::CX::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. However, Dialogflow itself does not try to read or process the URI in any way.

    Note: The following fields are mutually exclusive: play_audio, text, payload, conversation_success, output_audio_text, live_agent_handoff, end_interaction, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Dialogflow::CX::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. However, Dialogflow itself does not try to read or process the URI in any way.

    Note: The following fields are mutually exclusive: play_audio, text, payload, conversation_success, output_audio_text, live_agent_handoff, end_interaction, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#response_type

def response_type() -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ResponseType

#response_type=

def response_type=(value) -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ResponseType

#telephony_transfer_call

def telephony_transfer_call() -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::TelephonyTransferCall
Returns
  • (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::TelephonyTransferCall) — A signal that the client should transfer the phone call connected to this agent to a third-party endpoint.

    Note: The following fields are mutually exclusive: telephony_transfer_call, text, payload, conversation_success, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#telephony_transfer_call=

def telephony_transfer_call=(value) -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::TelephonyTransferCall
Parameter
  • value (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::TelephonyTransferCall) — A signal that the client should transfer the phone call connected to this agent to a third-party endpoint.

    Note: The following fields are mutually exclusive: telephony_transfer_call, text, payload, conversation_success, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::TelephonyTransferCall) — A signal that the client should transfer the phone call connected to this agent to a third-party endpoint.

    Note: The following fields are mutually exclusive: telephony_transfer_call, text, payload, conversation_success, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#text

def text() -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::Text
Returns
  • (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::Text) — Returns a text response.

    Note: The following fields are mutually exclusive: text, payload, conversation_success, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

#text=

def text=(value) -> ::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::Text
Parameter
  • value (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::Text) — Returns a text response.

    Note: The following fields are mutually exclusive: text, payload, conversation_success, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::Text) — Returns a text response.

    Note: The following fields are mutually exclusive: text, payload, conversation_success, output_audio_text, live_agent_handoff, end_interaction, play_audio, mixed_audio, telephony_transfer_call, knowledge_info_card. If a field in that set is populated, all other fields in the set will automatically be cleared.