You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have worked out a prototype for how I think dialogs could work in the context of our SDK. Since many of our customers use dialogs this is an important feature to get right, the following code examples are for typescript and may not be identical to how the feature gets implemented in sibling languages.
Goals
Simplify: From what I can see in the botbuilder examples, creating dialogs can be verbose.
State: Create a cohesive experience for a dialog to interact with our TurnState.
Examples
app.activity(ActivityTypes.Message,async(context: TurnContext,state: ApplicationTurnState)=>{// // Increment count stateletcount=state.conversation.value.count??0;state.conversation.value.count=++count;awaitapp.dialog('MAIN').addDialog(newWaterfallDialog('WATERFALL_DIALOG',[asyncstep=>{returnstep.prompt('NUMBER_PROMPT',{prompt: 'Please enter your age.',retryPrompt: 'The value entered must be greater than 0 and less than 150.'});},asyncstep=>{awaitstep.context.sendActivity(`your number is: ${step.result}, count: ${count}`);returnstep.endDialog();}])).addDialog(newNumberPrompt('NUMBER_PROMPT')).startOrContinue(context);});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Introduction
I have worked out a prototype for how I think dialogs could work in the context of our SDK. Since many of our customers use dialogs this is an important feature to get right, the following code examples are for
typescript
and may not be identical to how the feature gets implemented in sibling languages.Goals
TurnState
.Examples
Nesting
You can also nest dialogs:
Beta Was this translation helpful? Give feedback.
All reactions