Rasa is an open source machine learning framework for automated text and voice-based conversations. Understand messages, hold conversations, and connect to messaging channels and APIs.
- From the Rasa documentation
What you will learn
- How to forward Airy Core messages to Rasa
- How to configure Rasa to receive and reply to messages using Airy
Out of the box Rasa offers you a standard set of messaging channels to connect to. However, you can only connect to one Facebook page for instance at a time. This is perfectly fine for simple use cases, but as your platform grows and you want to scale your bot interactions across many channels you will need a dedicated solution for storing and routing messages.
This is where Airy Core can provide great scale benefits: You can connect a wide array of messaging channels and service them in a single inbox. For Rasa, you can think of it as a forward messaging router that will persist your data and make it available for export to anywhere within your organization.
This guide covers how to configure your Rasa installation so that it can use Airy Core to send and receive messages.
Airy Core can forward messages from your sources (Messenger, WhatsApp etc.) to downstream messaging frameworks like Rasa, which can in turn reply using the Airy Core API.
To do this we follow the webhook documentation to forward in-
and outbound messages to Rasa. When doing so set the
url parameter so that it
points to your Rasa installation. If it is running locally you can obtain a
public url by using ngrok. Run:
to get an ngrok URL that points to your local Rasa installation at
localhost:5005. With the public ngrok URL your webhook subscription payload
should look like so:
Once you have done this, the Airy Core will start sending messages to the url you specified.
We will be implementing a custom connector as we want to make use of the Airy Core API.
The first step is to create a new directory
channels/ in our Rasa project and
copy this connector
file into it.
The connector requires the following configuration values:
system_tokenthe Airy Core system token used for authenticating with the API.
api_hostThe url where you host your Airy Core API.
Add them to your existing Rasa
Now you should have a working integration 🎉.
To test the connection write a message to one of your channels: Airy Core will forward it to your Rasa installation, which will respond using the Airy Core API. This is what you should see in the logs of the demo repository: