Entities to database


I want to store the accepted slot values into a sql database and I dont know how to implement this.

Any help would be appreciated

You can do this inside the FormValidationAction (see here). For each slot value, in the validate_<slot name> method, once the slot is accepted you can call another method you’ve written to write the value to the database.

This is not an official rasa tutorial, so please use this at your own risk, but it may be a good starting point: tutorial.

The high level idea is:

  1. connect to the database (there are libraries for this, depending on which database you choose, e.g. mysql.connector)
  2. write an INSERT query for the value you want to insert into the table you want to insert
  3. execute this query with your slot value