Class UtteranceSpecification

    • Method Detail

      • botAliasId

        public final String botAliasId()

        The identifier of the alias of the bot that the utterance was made to.

        Returns:
        The identifier of the alias of the bot that the utterance was made to.
      • botVersion

        public final String botVersion()

        The version of the bot that the utterance was made to.

        Returns:
        The version of the bot that the utterance was made to.
      • localeId

        public final String localeId()

        The locale of the bot that the utterance was made to.

        Returns:
        The locale of the bot that the utterance was made to.
      • sessionId

        public final String sessionId()

        The identifier of the session that the utterance was made in.

        Returns:
        The identifier of the session that the utterance was made in.
      • channel

        public final String channel()

        The channel that is integrated with the bot that the utterance was made to.

        Returns:
        The channel that is integrated with the bot that the utterance was made to.
      • mode

        public final AnalyticsModality mode()

        The mode of the session. The possible values are as follows:

        • Speech – The session consisted of spoken dialogue.

        • Text – The session consisted of written dialogue.

        • DTMF – The session consisted of touch-tone keypad (Dual Tone Multi-Frequency) key presses.

        • MultiMode – The session consisted of multiple modes.

        If the service returns an enum value that is not available in the current SDK version, mode will return AnalyticsModality.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from modeAsString().

        Returns:
        The mode of the session. The possible values are as follows:

        • Speech – The session consisted of spoken dialogue.

        • Text – The session consisted of written dialogue.

        • DTMF – The session consisted of touch-tone keypad (Dual Tone Multi-Frequency) key presses.

        • MultiMode – The session consisted of multiple modes.

        See Also:
        AnalyticsModality
      • modeAsString

        public final String modeAsString()

        The mode of the session. The possible values are as follows:

        • Speech – The session consisted of spoken dialogue.

        • Text – The session consisted of written dialogue.

        • DTMF – The session consisted of touch-tone keypad (Dual Tone Multi-Frequency) key presses.

        • MultiMode – The session consisted of multiple modes.

        If the service returns an enum value that is not available in the current SDK version, mode will return AnalyticsModality.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from modeAsString().

        Returns:
        The mode of the session. The possible values are as follows:

        • Speech – The session consisted of spoken dialogue.

        • Text – The session consisted of written dialogue.

        • DTMF – The session consisted of touch-tone keypad (Dual Tone Multi-Frequency) key presses.

        • MultiMode – The session consisted of multiple modes.

        See Also:
        AnalyticsModality
      • conversationStartTime

        public final Instant conversationStartTime()

        The date and time when the conversation in which the utterance took place began. A conversation is defined as a unique combination of a sessionId and an originatingRequestId.

        Returns:
        The date and time when the conversation in which the utterance took place began. A conversation is defined as a unique combination of a sessionId and an originatingRequestId.
      • conversationEndTime

        public final Instant conversationEndTime()

        The date and time when the conversation in which the utterance took place ended. A conversation is defined as a unique combination of a sessionId and an originatingRequestId.

        Returns:
        The date and time when the conversation in which the utterance took place ended. A conversation is defined as a unique combination of a sessionId and an originatingRequestId.
      • utterance

        public final String utterance()

        The text of the utterance.

        Returns:
        The text of the utterance.
      • utteranceTimestamp

        public final Instant utteranceTimestamp()

        The date and time when the utterance took place.

        Returns:
        The date and time when the utterance took place.
      • audioVoiceDurationMillis

        public final Long audioVoiceDurationMillis()

        The duration in milliseconds of the audio associated with the utterance.

        Returns:
        The duration in milliseconds of the audio associated with the utterance.
      • utteranceUnderstood

        public final Boolean utteranceUnderstood()

        Specifies whether the bot understood the utterance or not.

        Returns:
        Specifies whether the bot understood the utterance or not.
      • inputType

        public final String inputType()

        The input type of the utterance. The possible values are as follows:

        • PCM format: audio data must be in little-endian byte order.

          • audio/l16; rate=16000; channels=1

          • audio/x-l16; sample-rate=16000; channel-count=1

          • audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false

        • Opus format

          • audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4

        • Text format

          • text/plain; charset=utf-8

        Returns:
        The input type of the utterance. The possible values are as follows:

        • PCM format: audio data must be in little-endian byte order.

          • audio/l16; rate=16000; channels=1

          • audio/x-l16; sample-rate=16000; channel-count=1

          • audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false

        • Opus format

          • audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4

        • Text format

          • text/plain; charset=utf-8

      • outputType

        public final String outputType()

        The output type of the utterance. The possible values are as follows:

        • audio/mpeg

        • audio/ogg

        • audio/pcm (16 KHz)

        • audio/ (defaults to mpeg)

        • text/plain; charset=utf-8

        Returns:
        The output type of the utterance. The possible values are as follows:

        • audio/mpeg

        • audio/ogg

        • audio/pcm (16 KHz)

        • audio/ (defaults to mpeg)

        • text/plain; charset=utf-8

      • associatedIntentName

        public final String associatedIntentName()

        The name of the intent that the utterance is associated to.

        Returns:
        The name of the intent that the utterance is associated to.
      • associatedSlotName

        public final String associatedSlotName()

        The name of the slot that the utterance is associated to.

        Returns:
        The name of the slot that the utterance is associated to.
      • intentStateAsString

        public final String intentStateAsString()

        The state of the intent that the utterance is associated to.

        If the service returns an enum value that is not available in the current SDK version, intentState will return IntentState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from intentStateAsString().

        Returns:
        The state of the intent that the utterance is associated to.
        See Also:
        IntentState
      • dialogActionType

        public final String dialogActionType()

        The type of dialog action that the utterance is associated to. See the type field in DialogAction for more information.

        Returns:
        The type of dialog action that the utterance is associated to. See the type field in DialogAction for more information.
      • botResponseAudioVoiceId

        public final String botResponseAudioVoiceId()

        The identifier for the audio of the bot response.

        Returns:
        The identifier for the audio of the bot response.
      • slotsFilledInSession

        public final String slotsFilledInSession()

        The slots that have been filled in the session by the time of the utterance.

        Returns:
        The slots that have been filled in the session by the time of the utterance.
      • utteranceRequestId

        public final String utteranceRequestId()

        The identifier of the request associated with the utterance.

        Returns:
        The identifier of the request associated with the utterance.
      • hasBotResponses

        public final boolean hasBotResponses()
        For responses, this returns true if the service returned a value for the BotResponses property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
      • botResponses

        public final List<UtteranceBotResponse> botResponses()

        A list of objects containing information about the bot response to the utterance.

        Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

        This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasBotResponses() method.

        Returns:
        A list of objects containing information about the bot response to the utterance.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public final String toString()
        Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
        Overrides:
        toString in class Object
      • getValueForField

        public final <T> Optional<T> getValueForField​(String fieldName,
                                                      Class<T> clazz)