Class: Google::Apis::DialogflowV2::GoogleCloudDialogflowCxV3ResponseMessage

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/dialogflow_v2/classes.rb,
lib/google/apis/dialogflow_v2/representations.rb,
lib/google/apis/dialogflow_v2/representations.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDialogflowCxV3ResponseMessage

Returns a new instance of GoogleCloudDialogflowCxV3ResponseMessage.



2535
2536
2537
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2535

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#channelString

The channel which the response is associated with. Clients can specify the channel via QueryParameters.channel, and only associated channel response will be returned. Corresponds to the JSON property channel

Returns:

  • (String)


2456
2457
2458
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2456

def channel
  @channel
end

#conversation_successGoogle::Apis::DialogflowV2::GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess

Indicates that the conversation succeeded, i.e., the bot handled the issue that the customer talked to it about. Dialogflow only uses this to determine which conversations should be counted as successful and doesn't process the metadata in this message in any way. Note that Dialogflow also considers conversations that get to the conversation end page as successful even if they don't return ConversationSuccess. You may set this, for example: * In the entry_fulfillment of a Page if entering the page indicates that the conversation succeeded. * In a webhook response when you determine that you handled the customer issue. Corresponds to the JSON property conversationSuccess



2469
2470
2471
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2469

def conversation_success
  @conversation_success
end

#end_interactionGoogle::Apis::DialogflowV2::GoogleCloudDialogflowCxV3ResponseMessageEndInteraction

Indicates that interaction with the Dialogflow agent has ended. This message is generated by Dialogflow only and not supposed to be defined by the user. Corresponds to the JSON property endInteraction



2475
2476
2477
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2475

def end_interaction
  @end_interaction
end

#knowledge_info_cardGoogle::Apis::DialogflowV2::GoogleCloudDialogflowCxV3ResponseMessageKnowledgeInfoCard

Represents info card response. If the response contains generative knowledge prediction, Dialogflow will return a payload with Infobot Messenger compatible info card. Otherwise, the info card response is skipped. Corresponds to the JSON property knowledgeInfoCard



2482
2483
2484
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2482

def knowledge_info_card
  @knowledge_info_card
end

#live_agent_handoffGoogle::Apis::DialogflowV2::GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff

Indicates that the conversation should be handed off to a live agent. Dialogflow only uses this to determine which conversations were handed off to a human agent for measurement purposes. What else to do with this signal is up to you and your handoff procedures. You may set this, for example: * In the entry_fulfillment of a Page if entering the page indicates something went extremely wrong in the conversation. * In a webhook response when you determine that the customer issue can only be handled by a human. Corresponds to the JSON property liveAgentHandoff



2493
2494
2495
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2493

def live_agent_handoff
  @live_agent_handoff
end

#mixed_audioGoogle::Apis::DialogflowV2::GoogleCloudDialogflowCxV3ResponseMessageMixedAudio

Represents an audio message that is composed of both segments synthesized from the Dialogflow agent prompts and ones hosted externally at the specified URIs. The external URIs are specified via play_audio. This message is generated by Dialogflow only and not supposed to be defined by the user. Corresponds to the JSON property mixedAudio



2501
2502
2503
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2501

def mixed_audio
  @mixed_audio
end

#output_audio_textGoogle::Apis::DialogflowV2::GoogleCloudDialogflowCxV3ResponseMessageOutputAudioText

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



2507
2508
2509
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2507

def output_audio_text
  @output_audio_text
end

#payloadHash<String,Object>

Returns a response containing a custom, platform-specific payload. Corresponds to the JSON property payload

Returns:

  • (Hash<String,Object>)


2512
2513
2514
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2512

def payload
  @payload
end

#play_audioGoogle::Apis::DialogflowV2::GoogleCloudDialogflowCxV3ResponseMessagePlayAudio

Specifies an audio clip to be played by the client as part of the response. Corresponds to the JSON property playAudio



2517
2518
2519
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2517

def play_audio
  @play_audio
end

#response_typeString

Response type. Corresponds to the JSON property responseType

Returns:

  • (String)


2522
2523
2524
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2522

def response_type
  @response_type
end

#telephony_transfer_callGoogle::Apis::DialogflowV2::GoogleCloudDialogflowCxV3ResponseMessageTelephonyTransferCall

Represents the signal that telles the client to transfer the phone call connected to the agent to a third-party endpoint. Corresponds to the JSON property telephonyTransferCall



2528
2529
2530
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2528

def telephony_transfer_call
  @telephony_transfer_call
end

#textGoogle::Apis::DialogflowV2::GoogleCloudDialogflowCxV3ResponseMessageText

The text response message. Corresponds to the JSON property text



2533
2534
2535
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2533

def text
  @text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 2540

def update!(**args)
  @channel = args[:channel] if args.key?(:channel)
  @conversation_success = args[:conversation_success] if args.key?(:conversation_success)
  @end_interaction = args[:end_interaction] if args.key?(:end_interaction)
  @knowledge_info_card = args[:knowledge_info_card] if args.key?(:knowledge_info_card)
  @live_agent_handoff = args[:live_agent_handoff] if args.key?(:live_agent_handoff)
  @mixed_audio = args[:mixed_audio] if args.key?(:mixed_audio)
  @output_audio_text = args[:output_audio_text] if args.key?(:output_audio_text)
  @payload = args[:payload] if args.key?(:payload)
  @play_audio = args[:play_audio] if args.key?(:play_audio)
  @response_type = args[:response_type] if args.key?(:response_type)
  @telephony_transfer_call = args[:telephony_transfer_call] if args.key?(:telephony_transfer_call)
  @text = args[:text] if args.key?(:text)
end