@bottender/rasa
v1.5.5
Published
Rasa NLU integration for Bottender.
Downloads
143
Readme
@bottender/rasa
Rasa NLU integration for Bottender.
Installation
You can install it with npm:
npm install @bottender/rasa
or Yarn:
yarn add @bottender/rasa
Usage
const { chain } = require('bottender');
const rasa = require('@bottender/rasa');
async function SayHello(context) {
await context.sendText('Hello!');
}
async function Unknown(context) {
await context.sendText('Sorry, I don’t know what you say.');
}
const Rasa = rasa({
origin: 'http://localhost:5005',
actions: {
greeting: SayHello,
},
confidenceThreshold: 0.7,
});
module.exports = async function App() {
return chain([
Rasa, //
Unknown,
]);
};
Reference
origin
The origin of the Rasa NLU server.
Type: string
.
Required.
actions
Actions to be executed when the event matches corresponding intent.
Type: Record<string, Action>
.
Required.
confidenceThreshold
Threshold of the answer confidence. The action only be executed when confidence is over this threshold.
Type: number
.
Required.
emulationMode,
The emulation mode to use in the request.
Type: 'WIT' | 'LUIS' | 'DIALOGFLOW'
.
Optional.
jwt
The JSON Web Token (JWT) to use in the request.
Type: string
.
Optional.
License
MIT © Yoctol