Rasa Integration via an Event Broker
Create a bot API key
Each bot needs its own API key for tracking.
Create a bot to get an API key. Make sure to choose Rasa as the platform.
Install Dashbot via Pip
pip install dashbot
Use the API key created above.
Rasa Event Brokers api produces a message onto a message broker, which is then used to consume the event. In the message broker consumer code, import our python library:
from dashbot import rasa
Consume events with Dashbot
Then, use our library to publish events as part of your consumer code. As suggested below, call the dashbot rasa code with your api key in place of API_KEY_HERE. The example code below is for consuming rabbitmq messages via pika.
def _callback(ch, method, properties, body):event = json.loads(body)db = rasa.rasa(API_KEY_HERE)db.publish(event)
Adding PII Redaction
Please read the installation steps for the dashbot package and the PII redaction package on this page before you continue. If you would like to use the rules-based PII redaction capabilities offered by the open source package, please call the method in our dashbot package with the redact parameter, as demonstrated in the example code below, which uses rabbitmq as the message broker and the pika rabbitmq client library.
def _callback(ch, method, properties, body):event = json.loads(body)db = rasa.rasa(API_KEY_HERE, redact=True)db.publish(event)