Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ControlInteractionModelGenerator

Interaction model generator for skills that use the Controls Framework.

This class extends InteractionModelGenerator with Controls-specific functionality.

Hierarchy

Properties

Protected delegationStrategy

delegationStrategy: DelegationStrategyType

Protected dialogIntents

dialogIntents: DialogIntent[] = []

Protected intents

intents: Intent[] = []

Protected invocationName

invocationName: string

Protected modelConfiguration

modelConfiguration: ModelConfiguration | undefined

Protected prompts

prompts: Prompt[] = []

Protected slotTypes

slotTypes: SlotType[] = []

targetSlotIds

targetSlotIds: Set<string> = new Set()

Methods

addControlIntent

  • Adds the information from a ControlIntent to the interaction model.

    Parameters

    • controlIntent: BaseControlIntent

      ControlIntent that extends BaseControlIntent

    • controlIMData: ModelData

      Localization data for built-ins.

    Returns this

addDelegationStrategy

  • addDelegationStrategy(delegationStrategy: DelegationStrategyType): this
  • Add DelegationStrategy to the dialog model.

    Parameters

    • delegationStrategy: DelegationStrategyType

    Returns this

addDialogIntent

  • addDialogIntent(dialogIntent: DialogIntent): this
  • Add a DialogIntent to the dialog model.

    Parameters

    • dialogIntent: DialogIntent

    Returns this

addDialogIntents

  • addDialogIntents(...dialogIntents: DialogIntent[]): this
  • Add DialogIntents to the dialog model.

    Parameters

    • Rest ...dialogIntents: DialogIntent[]

    Returns this

addIntent

  • addIntent(intent: Intent): this
  • Add intent to interaction model

    Parameters

    • intent: Intent

      Intent

    Returns this

addIntents

  • addIntents(...intents: Intent[]): this
  • Add one or more intents

    Parameters

    • Rest ...intents: Intent[]

    Returns this

addOrMergeSlotType

  • addOrMergeSlotType(slotType: SlotType): this
  • Add or merge slot type

    If the slot and/or slot-values already exist, the new data is added.

    Parameters

    • slotType: SlotType

    Returns this

addOrMergeSlotTypes

  • addOrMergeSlotTypes(...slotTypes: SlotType[]): this
  • Add or merge slot types

    If the slot and/or slot-values already exist, the new data is added.

    Parameters

    • Rest ...slotTypes: SlotType[]

    Returns this

addPrompt

  • addPrompt(prompt: Prompt): this
  • Add a Prompt to the dialog model.

    Parameters

    • prompt: Prompt

    Returns this

addPrompts

  • addPrompts(...prompts: Prompt[]): this
  • Add Prompts to the dialog model.

    Parameters

    • Rest ...prompts: Prompt[]

    Returns this

addValuesToSlotType

  • addValuesToSlotType(slotName: string, ...values: TypeValue[]): this
  • Add a new slot value to an existing slot type

    If the slot-value already exists, the new data is added.

    Parameters

    • slotName: string
    • Rest ...values: TypeValue[]

    Returns this

addYesAndNoIntents

  • Add AMAZON.YesIntent and AMAZON.NoIntent to the interaction model.

    Returns ControlInteractionModelGenerator

build

  • build(): InteractionModelData
  • Returns InteractionModelData

buildAndWrite

  • buildAndWrite(filename?: undefined | string): void
  • Build the interaction model and write to disk or standard output.

    Parameters

    • Optional filename: undefined | string

      Filename(optional)

    Returns void

buildCoreModelForControls

  • Adds content to the interaction model from a ControlManager.

    Behavior:

    • Calls controlManager.buildInteractionModel to update the IM
    • If any built-in controls are used, this also adds a dummy dialogModel to the interaction model to ensure that Dialog.SlotElicitation directive can be used.

    Usage:

    • If the built-in IM content does not include some desired locale, pass the appropriate data during instantiation of the ControlManager.

    Parameters

    Returns ControlInteractionModelGenerator

ensureSlotIsDefined

  • ensureSlotIsDefined(controlId: string, slotType: string): void
  • Parameters

    • controlId: string
    • slotType: string

    Returns void

ensureSlotIsNoneOrDefined

  • ensureSlotIsNoneOrDefined(controlId: string, slotType: string): void
  • Parameters

    • controlId: string
    • slotType: string

    Returns void

ensureSlotValueIDsAreDefined

  • ensureSlotValueIDsAreDefined(controlId: string, slotType: string, slotValueIds: string[]): void
  • Parameters

    • controlId: string
    • slotType: string
    • slotValueIds: string[]

    Returns void

ensureSlotValueIdIsDefined

  • ensureSlotValueIdIsDefined(controlId: string, slotType: string, slotValue: string): void
  • Parameters

    • controlId: string
    • slotType: string
    • slotValue: string

    Returns void

isSlotDefined

  • isSlotDefined(slotTypeId: string): boolean

isSlotValueIsDefined

  • isSlotValueIsDefined(slotTypeId: string, slotValueId: string): boolean

loadFromFile

  • loadFromFile(inputPath: string): this
  • Load an interaction model file (JSON format).

    Usage:

    • This method does not perform merging for all components. Call this method before any other methods.

    Parameters

    • inputPath: string

    Returns this

setModelConfiguration

  • setModelConfiguration(modelConfiguration: ModelConfiguration): this

withInvocationName

  • withInvocationName(name: string): this