SkillDialog class
A specialized Dialog that can wrap remote calls to a skill.
- Extends
-
Dialog<Partial<BeginSkillDialogOptions>>
Remarks
The options parameter in beginDialog must be a BeginSkillDialogOptions instance with the initial parameters for the dialog.
Constructors
Skill |
A sample dialog that can wrap remote calls to a skill. |
Properties
id | Unique ID of the dialog. Sets the unique ID of the dialog. |
telemetry |
Gets the telemetry client for this dialog. Sets the telemetry client for this dialog. |
Inherited Properties
End |
Gets a default end-of-turn result. |
Methods
begin |
Called when the skill dialog is started and pushed onto the dialog stack. |
continue |
Called when the skill dialog is continued, where it is the active dialog and the user replies with a new Activity. |
end |
Called when the skill dialog is ending. |
reprompt |
Called when the skill dialog should re-prompt the user for input. |
resume |
Called when a child skill dialog completed its turn, returning control to this dialog. |
Inherited Methods
configure(Record<string, unknown>) | Fluent method for configuring the object. |
get |
|
get |
An encoded string used to aid in the detection of bot changes on re-deployment. |
on |
Called when an event has been raised, using |
Constructor Details
SkillDialog(SkillDialogOptions, string)
A sample dialog that can wrap remote calls to a skill.
new SkillDialog(dialogOptions: SkillDialogOptions, dialogId?: string)
Parameters
- dialogOptions
- SkillDialogOptions
The options to execute the skill dialog.
- dialogId
-
string
The id of the dialog.
Remarks
The options parameter in beginDialog()
must be a SkillDialogArgs
object with the initial parameters
for the dialog.
Property Details
id
Unique ID of the dialog. Sets the unique ID of the dialog.
string id
Property Value
string
The Id for the dialog.
Remarks
This will be automatically generated if not specified.
telemetryClient
Gets the telemetry client for this dialog. Sets the telemetry client for this dialog.
BotTelemetryClient telemetryClient
Property Value
BotTelemetryClient
The BotTelemetryClient to use for logging.
Inherited Property Details
EndOfTurn
Gets a default end-of-turn result.
static EndOfTurn: DialogTurnResult
Property Value
Remarks
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.
Inherited From Dialog.EndOfTurn
Method Details
beginDialog(DialogContext, BeginSkillDialogOptions)
Called when the skill dialog is started and pushed onto the dialog stack.
function beginDialog(dc: DialogContext, options: BeginSkillDialogOptions): Promise<DialogTurnResult>
Parameters
The DialogContext for the current turn of conversation.
- options
- BeginSkillDialogOptions
Initial information to pass to the dialog.
Returns
Promise<DialogTurnResult>
A Promise representing the asynchronous operation.
Remarks
If the task is successful, the result indicates whether the dialog is still active after the turn has been processed by the dialog.
continueDialog(DialogContext)
Called when the skill dialog is continued, where it is the active dialog and the user replies with a new Activity.
function continueDialog(dc: DialogContext): Promise<DialogTurnResult>
Parameters
The DialogContext for the current turn of conversation.
Returns
Promise<DialogTurnResult>
A Promise representing the asynchronous operation.
Remarks
If the task is successful, the result indicates whether the dialog is still active after the turn has been processed by the dialog. The result may also contain a return value.
endDialog(TurnContext, DialogInstance, DialogReason)
Called when the skill dialog is ending.
function endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void>
Parameters
- context
-
TurnContext
The TurnContext object for this turn.
- instance
- DialogInstance
State information associated with the instance of this dialog on the dialog stack.
- reason
- DialogReason
(xref:botbuilder-dialogs.DialogReason) why the dialog ended.
Returns
Promise<void>
A Promise representing the asynchronous operation.
repromptDialog(TurnContext, DialogInstance)
Called when the skill dialog should re-prompt the user for input.
function repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void>
Parameters
- context
-
TurnContext
The TurnContext object for this turn.
- instance
- DialogInstance
State information for this dialog.
Returns
Promise<void>
A Promise representing the asynchronous operation.
resumeDialog(DialogContext, DialogReason, any)
Called when a child skill dialog completed its turn, returning control to this dialog.
function resumeDialog(dc: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult>
Parameters
The DialogContext for the current turn of the conversation.
- _reason
- DialogReason
(xref:botbuilder-dialogs.DialogReason) why the dialog resumed.
- _result
-
any
Optional, value returned from the dialog that was called. The type of the value returned is dependent on the child dialog.
Returns
Promise<DialogTurnResult>
A Promise representing the asynchronous operation.
Inherited Method Details
configure(Record<string, unknown>)
Fluent method for configuring the object.
function configure(config: Record<string, unknown>): this
Parameters
- config
-
Record<string, unknown>
Configuration settings to apply.
Returns
this
The Configurable after the operation is complete.
Inherited From Configurable.configure
getConverter(string)
function getConverter(_property: string): Converter | ConverterFactory
Parameters
- _property
-
string
The key of the conditional selector configuration.
Returns
The converter for the selector configuration.
Inherited From Configurable.getConverter
getVersion()
An encoded string used to aid in the detection of bot changes on re-deployment.
function getVersion(): string
Returns
string
Unique string which should only change when dialog has changed in a way that should restart the dialog.
Remarks
This defaults to returning the dialogs 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 bot,
an error will be thrown resulting in the bots error handler logic being run.
Returning an empty string will disable version tracking for the component all together.
Inherited From Dialog.getVersion
onDialogEvent(DialogContext, DialogEvent)
Called when an event has been raised, using DialogContext.emitEvent()
, by either the current dialog or a dialog that the current dialog started.
function onDialogEvent(dc: DialogContext, e: DialogEvent): Promise<boolean>
Parameters
The dialog context for the current turn of conversation.
The event being raised.
Returns
Promise<boolean>
True if the event is handled by the current dialog and bubbling should stop.
Inherited From Dialog.onDialogEvent