Options
All
  • Public
  • Public/Protected
  • All
Menu

Class InitiativeAct

Base type for System Acts that 'take the initiative'.

An act is 'taking the initiative' if it represents a direct question or otherwise encourages the user to continue the conversation.

Examples:

  • RequestValueAct is-a InitiativeAct. Sample prompt: "How many ducks?" (an explicit question requesting a response)
  • NextTaskAct is-a InitiativeAct. Sample prompt: "Next task please." (this is explicit encouragement to continue)

Usage:

  • Introduce a new InitiativeAct for any behavior that is not precisely captured by existing acts. The is no restriction on creating as many act types as necessary for a new control or skill

  • An InitiativeAct is not restricted to only represent initiative. It is valid to represent both initiative and some content if they are fundamentally connected. However, it is usual to define separate acts if they can reasonably be used in isolation.

Framework behavior:

  • The framework requires that every turn includes exactly one InitiativeAct except for terminal turns that stop the user's session. (by setting ControlResult.sessionBehavior)

Remarks:

  • Alexa certification policy requires that each turn that leaves the microphone open clearly prompts the user to reply or continue. Hence an initiative act must always be present and rendered clearly.
  • If Alexa's reply doesn't not explicitly encourage the user to continue the conversation, the session must be closed.

Hierarchy

Implements

Constructors

Properties

Methods

Constructors

constructor

Properties

control

control: Control

takesInitiative

takesInitiative: boolean

Methods

Abstract render

  • Render the dialog act.

    This is the one-size-fits-all direct rendering of a dialog act. This is often appropriate for custom acts that are not used by a shared control.

    Framework behavior:

    • Shared controls cannot rely on a one-size-fits-all rendering and so they provide their own appropriate defaults and props that allow the developer to override the defaults.

    Parameters

    Returns void

toString

  • toString(): string
  • Produces a string representation of the SystemAct.

    The associated Control.id is included but the complete details of the associate Control are omitted for brevity.

    Returns string