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

node-red-contrib-rasa-actionserver

v1.3.1

Published

action server for rasa conversational assistants

Downloads

102

Readme

node-red-contrib-rasa-actionserver

Rasa Action Server on Node-RED is a set of nodes that simplify the creation of custom actions for Rasa-powered chatbots. With Node-RED's intuitive low-code environment, building, testing, and maintaining custom actions for conversational assistants becomes faster and more accessible.

Built for Rasa v3.05+ and fully compatible with Node-RED v2.1.5+, this project supports the Rasa Action Server HTTP API, providing dedicated nodes for processing Rasa action requests, managing slots, and generating Rasa-compatible responses.

Key Features

  • Low-code Integration: Build action servers visually without extensive coding.
  • Simplified Testing: Use the simrasa node to simulate Rasa requests.
  • Custom Action Flexibility: Leverage Node-RED’s ecosystem to integrate APIs, databases, and other services.
  • Response Generation: Built-in nodes for text, button, and attachment responses.
  • Slot Management: Easily set, update, or clear Rasa slots

Background and Details

What is Rasa?

Rasa is a platform for building chatbots. Rasa chatbots can function as conversational assistants, allowing users to issue commands or requests in natural language, which the assistant fulfills seamlessly in the background.

When the conversational assistant encounters tasks that cannot be handled by its built-in functionality, it relies on custom coded actions. Rasa provides a Python SDK for implementing custom actions, but the necessary cooing effort can be a challenge for non-coders.

Alternatively, Rasa can delegate action fulfillment to a standalone action server, communicating with it via REST calls.

Fulfilling user requests often requires integration with additional systems. Thus, custom actions often need to connect to external services or APIs. Here, a visual low-code platform like Node-RED offers simple alternative to classical coding.

What is Node-RED?

Node-RED is a low-code platform running on Node.js. It offers a browser-based GUI where you can create flows by drag-and-dropping nodes from a palette onto a canvas. Flows in Node-RED consist of interconnected nodes that process JSON messages, perform actions, and exchange data with APIs, services, or devices.

Node-RED comes with built-in nodes for handling HTTP requests and responses, manipulating, JSON, conditional branching, and much more. Additionally, there is a wealth of contributed nodes from various sources, that are easily installed when more functionality is needed. This makes Node-RED well-suited for building Rasa action servers.

What is Rasa Action Server on Node-RED?

Rasa Action Server on Node-RED is a set of nodes that help using Node-RED flows as an Action Server for a Rasa chatbot. Specifically, these nodes implement the Rasa action server HTTP API as specified in Rasa Action Server HTTP API.

How to Use

Typical Flow Structure

A Rasa Action Server flow in Node-RED generally follows this structure:

  1. Start: An HTTP in node to receive incoming requests from Rasa.
  2. Initialization: An Init node to process the request and set up the flow context.
  3. Action Handling: Nodes that handle tasks such as API calls, database queries, or custom logic.
  4. Response Generation: Specialized nodes for creating responses in various formats (explained below).
  5. Response Assembly: A finish node to compile the response in a Rasa-compatible format.
  6. End: An HTTP response node to send the result back to Rasa.

Nodes for Generating Responses

The Rasa Action Server on Node-RED includes three nodes for transforming responses:

  • sendtext: Generates a simple text response.
  • sendbuttons: Creates a response with buttons for user interaction.
  • sendextra: Adds images or attachments to the response.

Each node provides two options for defining the response content:

  • Specify a fixed content directly in the node configuration.
  • Configure the node to retrieve the content dynamically from msg.payload.

Further nodes

Node for Managing Slots

Slots are a Rasa chatbot's memory mechanism, identified by a name and used to store dialogue-related information. Slot values are sent to the action server during a custom action request and often serve as parameters for the server's actions. For example, a weather bot may use a slot value for a location to provide relevant weather information.

Rasa Action Server on Node-RED facilitates reading and evaluating slot values. Additionally, the setslots node enables the clearing or updating of Rasa slots within a custom action.

Node for Testing Actions

The simrasa node is designed to simulate Rasa-like messages, allowing for action testing without requiring a live Rasa instance. The name simrasa stands for "Simulate Rasa."

Installation

  • Prerequisite: you have installed Node-RED
  • Add Node-RED-contrib-rasa-actionserver to Node-RED palette
  • Design your flow. Start it with an HTTP in node listening at /webhook
  • Configure the action server endpoint in Rasa endpoints.yml, e.g.,
action_endpoint:
    url: http://127.0.0.1:1880/webhook

Unit tests

Since version v1.2, Rasa Action Server on Node-RED includes unit tests. Furthermore, it includes a test setup comprising a small Rasa chatbot and a Node-RED flow.

References

How to cite

In academic contexts, please cite the paper mentioned above as

DOI