Skip to content

Conversation

Stevenic
Copy link
Contributor

@Stevenic Stevenic commented Nov 8, 2018

Description

Prototype of a new IntentDialog class for review. Sample usage:

const recognizer = new LuisRecognizer(settings);
const dialog = new IntentDialog('agePrompt', recognizer)
     .sendActivityIntent('Begin', `What is your age?`)
     .sendActivityIntent('Help', `Enter a number from 1 to 100`)
     .sendActivityIntent('None', `I'm sorry I didn't recognize your input. Please enter a number.`)
     .endDialogIntent('Cancel', -1)
     .onIntent('Age', async (intent) => {
          const age = intent.recognized.entities.age;
          if (typeof age === 'number' && age > 0 && age < 101) {
              return await intent.endDialog(age);
          } else if (intent.turns >= 3) {
              return await intent.endDialog(-1);
          } else {
              await intent.context.sendActivity(`Enter a number from 1 to 100`);
          }
          return Dialog.EndOfTurn;
     });

@coveralls
Copy link

coveralls commented Nov 8, 2018

Pull Request Test Coverage Report for Build 2095

  • 12 of 88 (13.64%) changed or added relevant lines in 3 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-1.9%) to 80.267%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/botbuilder-dialogs/src/intentDialogContext.ts 2 10 20.0%
libraries/botbuilder-dialogs/src/intentDialog.ts 8 76 10.53%
Files with Coverage Reduction New Missed Lines %
libraries/botframework-config/src/botConfigurationBase.ts 2 85.59%
Totals Coverage Status
Change from base Build 2073: -1.9%
Covered Lines: 2643
Relevant Lines: 3176

💛 - Coveralls

@gabog gabog closed this Apr 24, 2019
@gabog gabog deleted the stevenic/intent-dialog branch April 24, 2019 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants