Class ResponseMessage

  • All Implemented Interfaces:
    ResponseMessageOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class ResponseMessage
    extends com.google.protobuf.GeneratedMessageV3
    implements ResponseMessageOrBuilder
     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.
     
    Protobuf type google.cloud.dialogflow.cx.v3.ResponseMessage
    See Also:
    Serialized Form
    • Field Detail

      • CONVERSATION_SUCCESS_FIELD_NUMBER

        public static final int CONVERSATION_SUCCESS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • OUTPUT_AUDIO_TEXT_FIELD_NUMBER

        public static final int OUTPUT_AUDIO_TEXT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • LIVE_AGENT_HANDOFF_FIELD_NUMBER

        public static final int LIVE_AGENT_HANDOFF_FIELD_NUMBER
        See Also:
        Constant Field Values
      • END_INTERACTION_FIELD_NUMBER

        public static final int END_INTERACTION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • PLAY_AUDIO_FIELD_NUMBER

        public static final int PLAY_AUDIO_FIELD_NUMBER
        See Also:
        Constant Field Values
      • MIXED_AUDIO_FIELD_NUMBER

        public static final int MIXED_AUDIO_FIELD_NUMBER
        See Also:
        Constant Field Values
      • TELEPHONY_TRANSFER_CALL_FIELD_NUMBER

        public static final int TELEPHONY_TRANSFER_CALL_FIELD_NUMBER
        See Also:
        Constant Field Values
      • KNOWLEDGE_INFO_CARD_FIELD_NUMBER

        public static final int KNOWLEDGE_INFO_CARD_FIELD_NUMBER
        See Also:
        Constant Field Values
      • RESPONSE_TYPE_FIELD_NUMBER

        public static final int RESPONSE_TYPE_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • hasText

        public boolean hasText()
         Returns a text response.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.Text text = 1;
        Specified by:
        hasText in interface ResponseMessageOrBuilder
        Returns:
        Whether the text field is set.
      • hasPayload

        public boolean hasPayload()
         Returns a response containing a custom, platform-specific payload.
         
        .google.protobuf.Struct payload = 2;
        Specified by:
        hasPayload in interface ResponseMessageOrBuilder
        Returns:
        Whether the payload field is set.
      • getPayload

        public com.google.protobuf.Struct getPayload()
         Returns a response containing a custom, platform-specific payload.
         
        .google.protobuf.Struct payload = 2;
        Specified by:
        getPayload in interface ResponseMessageOrBuilder
        Returns:
        The payload.
      • getPayloadOrBuilder

        public com.google.protobuf.StructOrBuilder getPayloadOrBuilder()
         Returns a response containing a custom, platform-specific payload.
         
        .google.protobuf.Struct payload = 2;
        Specified by:
        getPayloadOrBuilder in interface ResponseMessageOrBuilder
      • hasConversationSuccess

        public boolean hasConversationSuccess()
         Indicates that the conversation succeeded.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess conversation_success = 9;
        Specified by:
        hasConversationSuccess in interface ResponseMessageOrBuilder
        Returns:
        Whether the conversationSuccess field is set.
      • hasOutputAudioText

        public boolean hasOutputAudioText()
         A text or ssml response that is preferentially used for TTS output audio
         synthesis, as described in the comment on the ResponseMessage message.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText output_audio_text = 8;
        Specified by:
        hasOutputAudioText in interface ResponseMessageOrBuilder
        Returns:
        Whether the outputAudioText field is set.
      • getOutputAudioText

        public ResponseMessage.OutputAudioText getOutputAudioText()
         A text or ssml response that is preferentially used for TTS output audio
         synthesis, as described in the comment on the ResponseMessage message.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText output_audio_text = 8;
        Specified by:
        getOutputAudioText in interface ResponseMessageOrBuilder
        Returns:
        The outputAudioText.
      • hasLiveAgentHandoff

        public boolean hasLiveAgentHandoff()
         Hands off conversation to a human agent.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10;
        Specified by:
        hasLiveAgentHandoff in interface ResponseMessageOrBuilder
        Returns:
        Whether the liveAgentHandoff field is set.
      • hasEndInteraction

        public boolean hasEndInteraction()
         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.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        hasEndInteraction in interface ResponseMessageOrBuilder
        Returns:
        Whether the endInteraction field is set.
      • getEndInteraction

        public ResponseMessage.EndInteraction 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.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getEndInteraction in interface ResponseMessageOrBuilder
        Returns:
        The endInteraction.
      • getEndInteractionOrBuilder

        public ResponseMessage.EndInteractionOrBuilder getEndInteractionOrBuilder()
         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.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getEndInteractionOrBuilder in interface ResponseMessageOrBuilder
      • hasPlayAudio

        public boolean hasPlayAudio()
         Signal that the client should play an audio clip hosted at a
         client-specific URI. Dialogflow uses this to construct
         [mixed_audio][google.cloud.dialogflow.cx.v3.ResponseMessage.mixed_audio].
         However, Dialogflow itself does not try to read or process the URI in any
         way.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio play_audio = 12;
        Specified by:
        hasPlayAudio in interface ResponseMessageOrBuilder
        Returns:
        Whether the playAudio field is set.
      • getPlayAudio

        public ResponseMessage.PlayAudio getPlayAudio()
         Signal that the client should play an audio clip hosted at a
         client-specific URI. Dialogflow uses this to construct
         [mixed_audio][google.cloud.dialogflow.cx.v3.ResponseMessage.mixed_audio].
         However, Dialogflow itself does not try to read or process the URI in any
         way.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio play_audio = 12;
        Specified by:
        getPlayAudio in interface ResponseMessageOrBuilder
        Returns:
        The playAudio.
      • getPlayAudioOrBuilder

        public ResponseMessage.PlayAudioOrBuilder getPlayAudioOrBuilder()
         Signal that the client should play an audio clip hosted at a
         client-specific URI. Dialogflow uses this to construct
         [mixed_audio][google.cloud.dialogflow.cx.v3.ResponseMessage.mixed_audio].
         However, Dialogflow itself does not try to read or process the URI in any
         way.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio play_audio = 12;
        Specified by:
        getPlayAudioOrBuilder in interface ResponseMessageOrBuilder
      • hasMixedAudio

        public boolean hasMixedAudio()
         Output only. An audio response message composed of both the synthesized
         Dialogflow agent responses and responses defined via
         [play_audio][google.cloud.dialogflow.cx.v3.ResponseMessage.play_audio].
         This message is generated by Dialogflow only and not supposed to be
         defined by the user.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        hasMixedAudio in interface ResponseMessageOrBuilder
        Returns:
        Whether the mixedAudio field is set.
      • getMixedAudio

        public ResponseMessage.MixedAudio getMixedAudio()
         Output only. An audio response message composed of both the synthesized
         Dialogflow agent responses and responses defined via
         [play_audio][google.cloud.dialogflow.cx.v3.ResponseMessage.play_audio].
         This message is generated by Dialogflow only and not supposed to be
         defined by the user.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getMixedAudio in interface ResponseMessageOrBuilder
        Returns:
        The mixedAudio.
      • getMixedAudioOrBuilder

        public ResponseMessage.MixedAudioOrBuilder getMixedAudioOrBuilder()
         Output only. An audio response message composed of both the synthesized
         Dialogflow agent responses and responses defined via
         [play_audio][google.cloud.dialogflow.cx.v3.ResponseMessage.play_audio].
         This message is generated by Dialogflow only and not supposed to be
         defined by the user.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getMixedAudioOrBuilder in interface ResponseMessageOrBuilder
      • hasTelephonyTransferCall

        public boolean hasTelephonyTransferCall()
         A signal that the client should transfer the phone call connected to
         this agent to a third-party endpoint.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 18;
        Specified by:
        hasTelephonyTransferCall in interface ResponseMessageOrBuilder
        Returns:
        Whether the telephonyTransferCall field is set.
      • hasKnowledgeInfoCard

        public boolean hasKnowledgeInfoCard()
         Represents info card for knowledge answers, to be better rendered in
         Dialogflow Messenger.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard knowledge_info_card = 20;
        Specified by:
        hasKnowledgeInfoCard in interface ResponseMessageOrBuilder
        Returns:
        Whether the knowledgeInfoCard field is set.
      • getResponseTypeValue

        public int getResponseTypeValue()
         Response type.
         
        .google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType response_type = 4;
        Specified by:
        getResponseTypeValue in interface ResponseMessageOrBuilder
        Returns:
        The enum numeric value on the wire for responseType.
      • getChannel

        public String getChannel()
         The channel which the response is associated with. Clients can specify the
         channel via
         [QueryParameters.channel][google.cloud.dialogflow.cx.v3.QueryParameters.channel],
         and only associated channel response will be returned.
         
        string channel = 19;
        Specified by:
        getChannel in interface ResponseMessageOrBuilder
        Returns:
        The channel.
      • getChannelBytes

        public com.google.protobuf.ByteString getChannelBytes()
         The channel which the response is associated with. Clients can specify the
         channel via
         [QueryParameters.channel][google.cloud.dialogflow.cx.v3.QueryParameters.channel],
         and only associated channel response will be returned.
         
        string channel = 19;
        Specified by:
        getChannelBytes in interface ResponseMessageOrBuilder
        Returns:
        The bytes for channel.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static ResponseMessage parseFrom​(ByteBuffer data)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ResponseMessage parseFrom​(ByteBuffer data,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ResponseMessage parseFrom​(com.google.protobuf.ByteString data)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ResponseMessage parseFrom​(com.google.protobuf.ByteString data,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ResponseMessage parseFrom​(byte[] data)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ResponseMessage parseFrom​(byte[] data,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ResponseMessage parseFrom​(com.google.protobuf.CodedInputStream input,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws IOException
        Throws:
        IOException
      • newBuilderForType

        public ResponseMessage.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public ResponseMessage.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected ResponseMessage.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • parser

        public static com.google.protobuf.Parser<ResponseMessage> parser()
      • getParserForType

        public com.google.protobuf.Parser<ResponseMessage> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public ResponseMessage getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder