How to force all messages to trigger python class?

Hello, I’m interested to capture every message being processed in Rasa by creating a python class which will store to database. I’m not exactly sure how to do this by default. I can trigger the class based on stories that match, but I can’t seem to figure out as a default.

Any guidance would be appreciated Thanks.

Hi @joggerjoel

May I know which message you are referring to and what are you planning to do by storing in database?

all messages

I’m interested in storing the timestamp/confidence make decisions future messages in realtime.

Hi @joggerjoel

These information’s are already saved to trackerstore database, if you want read from a DB. Else, they are readily available in the tracker object which you can access them via your custom actions.

Can you share me a specific example to see if I can help you out ?

Like interceptor …?

I added this to my endpoints.yml:

 tracker_store:
    type: SQL
    dialect: "mysql"
    url: "localhost:3306"
    db: "rasa"  # path to your db
    username:  root # username used for authentication
    password:  password # password used for authentication

rasa run --endpoints endpoints.yml created rasa database in mysql. But nothing is being updated and I don’t see anything on the startup console log.

Thoughts? Thanks.

Hi @joggerjoel

Please enable debug while starting up the rasa server and share the logs.

debug.txt (3.6 KB)

Hi @joggerjoel

From your logs, I can see rasa is still using its default Trackerstore & Lockstore

2021-04-27 05:52:53,435 [DEBUG]  Connected to InMemoryTrackerStore.
2021-04-27 05:52:53,435 [DEBUG]  Connected to lock store 'InMemoryLockStore'.

Also I see another rasa instance running because of which your current instance didn’t start up. Try killing the existing instance and start afresh.

Also ensure you are passing your endpoints.yml while starting rasa instance

./endpoints.yml

tracker_store:
    type: SQL
    dialect: "mysql"
    url: "mysql://localhost:3306"
    db: "rasa"  # path to your db
    username:  root # username used for authentication
    password:  password # password used for authentication

rasa run --endpoints endpoints.yml --debug --log-file log.txt apparently I had a space in front of “tracker_store” also, I had to remove mysql::// as it was expecting username password from URL

2021-04-28 10:08:32 DEBUG    rasa.core.tracker_store  - Attempting to connect to database via 'mysql://root:***@localhost:3306/rasa'.
2021-04-28 10:08:32 DEBUG    rasa.core.tracker_store  - Connection to SQL database 'rasa' successful.
2021-04-28 10:08:32 DEBUG    rasa.core.tracker_store  - Connected to SQLTrackerStore.

Now it works.

“timestamp”: 1619618811.1111634,

How to change this to a python printable time? Is this in milliseconds? whats the .1111634