4.23.2 • Published 4 months ago

botbuilder-ai v4.23.2

Weekly downloads
3,319
License
MIT
Repository
github
Last release
4 months 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.23.3-dev1

4 months ago

4.23.3-dev2

4 months ago

4.23.2-rc2

4 months ago

4.23.2

4 months ago

4.23.2-dev1

6 months ago

4.24.0-rc1

8 months ago

4.23.0-rc1

10 months ago

4.23.0

10 months ago

4.23.1

9 months ago

4.22.3

12 months ago

4.22.2

1 year ago

4.17.0-spike1

1 year ago

4.17.0-dev1

1 year ago

4.22.2-rc2

1 year ago

4.14.1-dev8

1 year ago

4.22.1

1 year ago

4.22.2-rc1

1 year ago

4.21.5-rc

1 year ago

4.22.0

1 year ago

4.14.1-dev7

1 year ago

4.14.1-dev6

1 year ago

4.21.4

1 year ago

4.14.1-dev5

1 year ago

4.21.4-rc2

1 year ago

4.21.4-rc

1 year ago

4.14.1-dev4

1 year ago

4.21.4-dev2

1 year ago

4.14.1-dev3

2 years ago

4.21.4-dev

2 years ago

4.21.3-rc

2 years ago

4.21.3

2 years ago

4.21.1

2 years ago

4.21.2

2 years ago

4.21.0

2 years ago

4.20.2

2 years ago

4.20.3

2 years ago

4.20.1

2 years ago

4.20.1-rc

2 years ago

4.21.1-rc2

2 years ago

4.14.1-dev1

2 years ago

4.14.1-dev2

2 years ago

4.21.1-rc

2 years ago

4.20.0-rc

2 years ago

4.20.0

2 years ago

4.19.3-rc

2 years ago

4.19.3-rc2

2 years ago

4.19.3-rc4

2 years ago

4.19.3-rc5

2 years ago

4.19.1-rc1

2 years ago

4.19.1

2 years ago

4.19.2

2 years ago

4.19.3

2 years ago

4.19.1-rc

2 years ago

4.19.0-rc

2 years ago

4.19.0

2 years ago

4.18.0-rc0

3 years ago

4.18.0

3 years ago

4.17.1-rc0-rc

3 years ago

4.17.1

3 years ago

4.17.0-rc

3 years ago

4.17.0

3 years ago

4.16.0

3 years ago

4.15.0

4 years ago

4.15.0-rc1

4 years ago

4.15.0-rc3

4 years ago

4.15.0-rc2

4 years ago

4.15.0-rc0

4 years ago

4.14.1

4 years ago

4.14.0

4 years ago

4.14.0-rc2

4 years ago

4.14.0-rc1

4 years ago

4.14.0-rc0

4 years ago

4.10.6-rc0

4 years ago

4.9.5

4 years ago

4.9.5-rc0

4 years ago

4.9.5-rc1

4 years ago

4.13.6

4 years ago

4.11.2-rc0

4 years ago

4.12.1-rc0

4 years ago

4.13.6-rc0

4 years ago

4.10.6

4 years ago

4.12.1

4 years ago

4.11.2

4 years ago

4.13.5

4 years ago

4.13.4

4 years ago

4.13.3

4 years ago

4.13.2

4 years ago

4.13.1

4 years ago

4.13.0

4 years ago

4.13.0-rc9

4 years ago

4.13.0-rc8

4 years ago

4.13.0-rc7

4 years ago

4.13.0-rc6

4 years ago

4.13.0-rc5

4 years ago

4.13.0-rc4

4 years ago

4.13.0-rc3

4 years ago

4.13.0-rc2

4 years ago

4.14.0-dev

4 years ago

4.13.0-rc0

4 years ago

4.13.0-rc1

4 years ago

4.12.0

4 years ago

4.12.0-rc4

4 years ago

4.12.0-rc3

4 years ago

4.12.0-rc2

4 years ago

4.12.0-rc1

4 years ago

4.12.0-rc0

4 years ago

4.11.1

4 years ago

4.10.5

4 years ago

4.9.4

5 years ago

4.8.1

5 years ago

4.7.3

5 years ago

4.11.1-rc0

5 years ago

4.11.0

5 years ago

4.11.0-rc3

5 years ago

4.11.0-rc2

5 years ago

4.11.0-rc1

5 years ago

4.11.0-rc0

5 years ago

4.10.4

5 years ago

4.10.3

5 years ago

4.10.2-rc0

5 years ago

4.10.1

5 years ago

4.10.0

5 years ago

4.10.0-rc1

5 years ago

4.10.0-rc0

5 years ago

4.9.3

5 years ago

4.9.2

5 years ago

4.9.1

5 years ago

4.9.0

5 years ago

4.8.0

5 years ago

4.7.2

5 years ago

4.7.1

5 years ago

4.7.0

6 years ago

4.6.2

6 years ago

4.6.1

6 years ago

4.6.0

6 years ago

4.6.0-preview1

6 years ago

4.5.3

6 years ago

4.5.2

6 years ago

4.5.1

6 years ago

4.5.0

6 years ago

4.4.0

6 years ago

4.3.4

6 years ago

4.3.2

6 years ago

4.2.1

6 years ago

4.2.0

7 years ago

4.1.7

7 years ago

4.1.6

7 years ago

4.1.5

7 years ago

4.1.3

7 years ago

4.0.8

7 years ago

4.0.6

7 years ago

4.0.0-preview1.2

7 years ago

4.0.0-preview1.1

7 years ago

4.0.0-preview1.0

7 years ago

4.0.0-m4.2

7 years ago

4.0.0-m4.1

7 years ago

4.0.0-m4.0

7 years ago

4.0.0-m3.0

7 years ago

4.0.0-m2.5

7 years ago

4.0.0-m2.4

7 years ago

4.0.0-m2.3

7 years ago

4.0.0-m2.2

7 years ago

4.0.0-m2.1

7 years ago

4.0.0-m2.0

7 years ago

4.0.0-m1.10

7 years ago

4.0.0-m1.7

7 years ago

4.0.0-m1.5

7 years ago

4.0.0-m1.2

7 years ago

4.0.0-m1.0

7 years ago

4.0.0-alpha2

7 years ago