Documentation - v1.2.0-alpha.3
    Preparing search index...

    Defines the core behavior for all dialogs.

    Type Parameters

    • O extends object = {}

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    EndOfTurn: DialogTurnResult = ...

    Gets a default end-of-turn result.

    This result indicates that a dialog (or a logical step within a dialog) has completed processing for the current turn, is still active, and is waiting for more input.

    Accessors

    Methods

    • When overridden in a derived class, performs clean up for the dialog before it ends.

      Parameters

      Returns Promise<void>

      Derived dialogs that need to perform logging or cleanup before ending should override this method. By default, this method has no effect.

      The DialogContext calls this method when the current dialog is ending.

    • An encoded string used to aid in the detection of agent changes on re-deployment.

      Returns string

      Unique string which should only change when dialog has changed in a way that should restart the dialog.

      This defaults to returning the dialog's id but can be overridden to provide more precise change detection logic. Any dialog on the stack that has its version change will result in a versionChanged event will be raised. If this event is not handled by the agent, an error will be thrown resulting in the agent error handler logic being run.

      Returning an empty string will disable version tracking for the component all together.

    • Called when a unique ID needs to be computed for a dialog.

      Returns string

      SHOULD be overridden to provide a more contextually relevant ID. The preferred pattern for ID's is <dialog type>(this.hashedLabel('<dialog args>')).

    • Called after an event was bubbled to all parents and wasn't handled.

      Parameters

      Returns Promise<boolean>

      Whether the event is handled by the current dialog and further processing should stop.

      This is a good place to perform default processing logic for an event. Returning true will prevent any processing of the event by child dialogs.

    • Called before an event is bubbled to its parent.

      Parameters

      Returns Promise<boolean>

      Whether the event is handled by the current dialog and further processing should stop.

      This is a good place to perform interception of an event as returning true will prevent any further bubbling of the event to the dialogs parents and will also prevent any child dialogs from performing their default processing.

    • When overridden in a derived class, prompts the user again for input.

      Parameters

      Returns Promise<void>

      Derived dialogs that support validation and re-prompt logic should override this method. By default, this method has no effect.

      The DialogContext calls this method when the current dialog should re-request input from the user. This method is implemented for prompt dialogs.

    • When overridden in a derived class, resumes the dialog after the dialog above it on the stack completes.

      Parameters

      • dc: DialogContext

        The context for the current dialog turn.

      • reason: DialogReason

        The reason the dialog is resuming. This will typically be DialogReason.endCalled

      • Optionalresult: any

        Optional. The return value, if any, from the dialog that ended.

      Returns Promise<DialogTurnResult<any>>

      A promise resolving to the dialog turn result.

      Derived dialogs that support multiple-turn conversations should override this method. By default, this method signals that the dialog is complete and returns.

      The DialogContext calls this method when it resumes the dialog. If the previous dialog on the stack returned a value, that value is in the result parameter.

      To start a child dialog, use DialogContext.beginDialog or DialogContext.prompt; however, this dialog will not necessarily be the one that started the child dialog. To signal to the dialog context that this dialog has completed, await DialogContext.endDialog before exiting this method.