4.22.2 • Published 12 days ago

botbuilder-ai v4.22.2

Weekly downloads
3,319
License
MIT
Repository
github
Last release
12 days ago

Bot Builder AI

Cognitive services extensions for Microsoft BotBuilder.

Installing

To add the latest version of this package to your bot:

npm install --save botbuilder-ai

Use the Daily Build

To get access to the daily builds of this library, configure npm to use the MyGet feed before installing.

npm config set registry https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/

To reset the registry in order to get the latest published version, run:

npm config set registry https://registry.npmjs.org/

What's included?

This module contains interfaces for using Microsoft LUIS and Microsoft QnA Maker in your Botbuilder application.

Use

First, import the nessary functionality into your app.

const { LuisRecognizer, QnAMaker } = require('botbuilder-ai');

Configure and instantiate a LuisRecognizer. You will need to acquire values for appId, subscriptionKey and region from the LUIS website.

// Map the contents to the required format for `LuisRecognizer`.
const luisApplication = {
    applicationId: process.env.appId,
    endpointKey: process.env.subscriptionKey,
    azureRegion: process.env.region
}

// Create configuration for LuisRecognizer's runtime behavior.
const luisPredictionOptions = {
    includeAllIntents: true,
    log: true,
    staging: false
}

const luisRecognizer = new LuisRecognizer(luisApplication, luisPredictionOptions, true);

Now, call LUIS into action once you've got a TurnContext object:

// Listen for incoming requests.
server.post('/api/messages', (req, res) => {
    adapter.processActivity(req, res, async (turnContext) => {
        const results = await luisRecognizer.recognize(turnContext);

        // Since the LuisRecognizer was configured to include the raw results, get the `topScoringIntent` as specified by LUIS.
        const topIntent = results.luisResult.topScoringIntent;

        // Now, use topIntent to decide what action to take.
        switch (topIntent) {
            case '<some intent>':
            // ... 
            break;
        }

    });
});

Examples

See this module in action in these example apps:

4.22.2

12 days ago

4.17.0-spike1

26 days ago

4.17.0-dev1

1 month ago

4.22.2-rc2

1 month ago

4.14.1-dev8

2 months ago

4.22.1

3 months ago

4.22.2-rc1

3 months ago

4.21.5-rc

3 months ago

4.22.0

3 months ago

4.14.1-dev7

3 months ago

4.14.1-dev6

3 months ago

4.21.4

4 months ago

4.14.1-dev5

4 months ago

4.21.4-rc2

4 months ago

4.21.4-rc

4 months ago

4.14.1-dev4

4 months ago

4.21.4-dev2

4 months ago

4.14.1-dev3

5 months ago

4.21.4-dev

5 months ago

4.21.3-rc

5 months ago

4.21.3

5 months ago

4.21.1

6 months ago

4.21.2

5 months ago

4.21.0

6 months ago

4.20.2

6 months ago

4.20.3

5 months ago

4.20.1

7 months ago

4.20.1-rc

7 months ago

4.21.1-rc2

6 months ago

4.14.1-dev1

6 months ago

4.14.1-dev2

5 months ago

4.21.1-rc

6 months ago

4.20.0-rc

11 months ago

4.20.0

11 months ago

4.19.3-rc

1 year ago

4.19.3-rc2

1 year ago

4.19.3-rc4

1 year ago

4.19.3-rc5

1 year ago

4.19.1-rc1

1 year ago

4.19.1

1 year ago

4.19.2

1 year ago

4.19.3

1 year ago

4.19.1-rc

1 year ago

4.19.0-rc

1 year ago

4.19.0

1 year ago

4.18.0-rc0

2 years ago

4.18.0

2 years ago

4.17.1-rc0-rc

2 years ago

4.17.1

2 years ago

4.17.0-rc

2 years ago

4.17.0

2 years ago

4.16.0

2 years ago

4.15.0

2 years ago

4.15.0-rc1

2 years ago

4.15.0-rc3

2 years ago

4.15.0-rc2

2 years ago

4.15.0-rc0

3 years ago

4.14.1

3 years ago

4.14.0

3 years ago

4.14.0-rc2

3 years ago

4.14.0-rc1

3 years ago

4.14.0-rc0

3 years ago

4.10.6-rc0

3 years ago

4.9.5

3 years ago

4.9.5-rc0

3 years ago

4.9.5-rc1

3 years ago

4.13.6

3 years ago

4.11.2-rc0

3 years ago

4.12.1-rc0

3 years ago

4.13.6-rc0

3 years ago

4.10.6

3 years ago

4.12.1

3 years ago

4.11.2

3 years ago

4.13.5

3 years ago

4.13.4

3 years ago

4.13.3

3 years ago

4.13.2

3 years ago

4.13.1

3 years ago

4.13.0

3 years ago

4.13.0-rc9

3 years ago

4.13.0-rc8

3 years ago

4.13.0-rc7

3 years ago

4.13.0-rc6

3 years ago

4.13.0-rc5

3 years ago

4.13.0-rc4

3 years ago

4.13.0-rc3

3 years ago

4.13.0-rc2

3 years ago

4.14.0-dev

3 years ago

4.13.0-rc0

3 years ago

4.13.0-rc1

3 years ago

4.12.0

3 years ago

4.12.0-rc4

3 years ago

4.12.0-rc3

3 years ago

4.12.0-rc2

3 years ago

4.12.0-rc1

3 years ago

4.12.0-rc0

3 years ago

4.11.1

3 years ago

4.10.5

3 years ago

4.9.4

3 years ago

4.8.1

3 years ago

4.7.3

3 years ago

4.11.1-rc0

3 years ago

4.11.0

3 years ago

4.11.0-rc3

3 years ago

4.11.0-rc2

3 years ago

4.11.0-rc1

3 years ago

4.11.0-rc0

4 years ago

4.10.4

4 years ago

4.10.3

4 years ago

4.10.2-rc0

4 years ago

4.10.1

4 years ago

4.10.0

4 years ago

4.10.0-rc1

4 years ago

4.10.0-rc0

4 years ago

4.9.3

4 years ago

4.9.2

4 years ago

4.9.1

4 years ago

4.9.0

4 years ago

4.8.0

4 years ago

4.7.2

4 years ago

4.7.1

4 years ago

4.7.0

4 years ago

4.6.2

4 years ago

4.6.1

4 years ago

4.6.0

4 years ago

4.6.0-preview1

5 years ago

4.5.3

5 years ago

4.5.2

5 years ago

4.5.1

5 years ago

4.5.0

5 years ago

4.4.0

5 years ago

4.3.4

5 years ago

4.3.2

5 years ago

4.2.1

5 years ago

4.2.0

5 years ago

4.1.7

5 years ago

4.1.6

5 years ago

4.1.5

5 years ago

4.1.3

5 years ago

4.0.8

6 years ago

4.0.6

6 years ago

4.0.0-preview1.2

6 years ago

4.0.0-preview1.1

6 years ago

4.0.0-preview1.0

6 years ago

4.0.0-m4.2

6 years ago

4.0.0-m4.1

6 years ago

4.0.0-m4.0

6 years ago

4.0.0-m3.0

6 years ago

4.0.0-m2.5

6 years ago

4.0.0-m2.4

6 years ago

4.0.0-m2.3

6 years ago

4.0.0-m2.2

6 years ago

4.0.0-m2.1

6 years ago

4.0.0-m2.0

6 years ago

4.0.0-m1.10

6 years ago

4.0.0-m1.7

6 years ago

4.0.0-m1.5

6 years ago

4.0.0-m1.2

6 years ago

4.0.0-m1.0

6 years ago

4.0.0-alpha2

6 years ago