npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

botkit-rasa

v1.0.7

Published

This plugin provides Botkit developers a way to use the [Rasa NLU](https://rasa.ai/) open source, self hosted natural language API.

Downloads

12

Readme

Botkit / Rasa NLU plugin

This plugin provides Botkit developers a way to use the Rasa NLU open source, self hosted natural language API.

Setup in your project

Install the plugin using the npm package

npm i --save botkit-rasa

Make your bot aware of the plugin:

var rasa = require('botkit-rasa')({rasa_uri: 'http://localhost:5000'});
controller.middleware.receive.use(rasa.receive);

controller.hears(['my_intent'],'message_received', rasa.hears, function(bot, message) {

    console.log('Intent:', message.intent);
    console.log('Entities:', message.entities);    

});

Example Slack bot

In the example directory there's a fully functional Slack bot sample.

This bot demonstrates some core features of Botkit leveraging Rasa NLU plugin:

  • Connect to Slack using the real time API
  • Receive messages based on "spoken" patterns
  • Reply to messages

Prerequisites

Run the example bot

Get Rasa NLU up and running by checking out their repository and following the instructions to setup a Rasa NLU instance. At this point you should have a Rasa NLU instance up and running.

Now get a Bot token from Slack (you will need this later when launching the bot from the command line):

  • http://my.slack.com/services/new/bot

Clone this repository and move into the example directory:

  • git clone https://github.com/sohlex/botkit-rasa.git

Open another terminal and from the example directory, run the commands (TOKEN is the one that you got before from the slack website):

  • npm install
  • slack_token=<TOKEN> node bot.js

Use the bot

Find your bot inside Slack to send it a direct message.

Say: "Hello"

The bot should reply "Hello!" If it didn't, there's a problem with Rasa NLU configuration, check the bot and Rasa console for errors.

Make sure to invite your bot into other channels using /invite @!

Extend the bot

If this middleware doesn't satisfy your needs, you can use it as inspiration for your implementations or contribute to this project! Furthermore, Botkit has many features for building cool and useful bots!

Read all about it here.

What this middleware does

Using this Rasa NLU middleware plugin for Botkit causes every message that is sent to your bot to be first sent to Rasa NLU for processing. The results of the call to Rasa NLU are added into the incoming message as message.intents and message.entities.

Using the Rasa NLU hears middleware tells Botkit to look for Rasa NLU intents information, and match them using this information instead of the built in pattern matching function.

You must create an intent in the understandings area of Rasa NLU and train it to register certain expressions.

More informations are available in the Rasa NLU documentation