Options
All
  • Public
  • Public/Protected
  • All
Menu

Module utils/IntentUtils

Functions

defaultIntentToValueMapper

  • defaultIntentToValueMapper(intent: Intent): string
  • Utility to extract a 'valueId' from common intent name shapes.

    Purpose:

    • this is intended to be used with the ListControl prop: nlu.slotValueConflictExtensions.intentToValueMapper

    Behavior: The name is processed with the following rules:

    • the longest prefix ending in a period is removed.
    • a suffix of 'Intent' is removed.
    • the first character of the result is converted to lowerCase

    Supported shapes:

      ThingIntent -> 'thing',
      SomeThingIntent -> 'someThing',
      AMAZON.YesIntent -> 'yes'
      AMAZON.ShuffleOffIntent -> 'shuffleOFf'

    Parameters

    • intent: Intent

    Returns string

getMVSSlotResolutions

  • If there is an ER-Success, this returns the canonical value id of the first match resolution along with isEntityResolutionMatch: boolean to indicate the status of ER_SUCCESS_MATCH Otherwise this returns the object of literal slot value and isEntityResolutionMatch set to false.

    Parameters

    • slot: Slot | undefined

      Slot

    Returns SlotResolutionValue | SlotResolutionValue[] | undefined

getSlotResolutions

  • If there is an ER-Success, this returns the canonical value id of the first match resolution along with isEntityResolutionMatch: boolean to indicate the status of ER_SUCCESS_MATCH Otherwise this returns the object of literal slot value and isEntityResolutionMatch set to false.

    Parameters

    • slot: Slot | undefined

      Slot

    Returns SlotResolutionValue | undefined