How to call Action server from an external client to fill slots with values in action.py

Hello everyone currently I am working on my college project and I will explain my scenario

I have made a chatbot using Rasa’s latest version and I need to send data to slots via the action server, implementing the logic in Action.py

please help me to sort it out…

problemSpec

Rasa is able to directly communicate with custom actions and slots will automatically be made available via the Tracker. There’s a brief intro about it here.

If you’d like to send an external request instead you may like to know that the action server comes with an HTTP API spec listed here. In general, it’s best not to communicate directly with the action server and to route everything via rasa open source instead.

@koaning Thanks for the reply. I got your points. to be much clearer I will explain my scenario much specifically.

step 01- I am going to send data from an external javascript to the chatbot

step 02 - I am going to process the received data (from external JavaScript) in a pipeline implemented in the action.py file

step 03 - the processed output values are to be set in the slots at the action.py file

step 04 - use in chats (not related to my problem)

and so far what I have found… HTTP API can’t be used since I want to process data before setting to slots. using HTTP API along with tracker object does not let me modify the values before setting in slots.

The solution that I found so far… write a simple script and convert it to rest API using Flask modules (Why Flask ? since it is Lightweight)

  • send data to the rest API
  • Access data from action.py
  • modify data
  • set slots

this is what my finding are. Please be kind enough to correct me if I am wrong and it’s great if you can suggest to me a better way.

This makes me wonder. Does it make sense to simply just host a Rasa Open Source service that can handle the NLU part and then use that response in your flask app? Technically you’d be moving the custom action into flask.

If you’re only interested in using the NLU part of Rasa, it’d also be a lot easier to move that into a flask app. You might find this blogpost useful if you’d like to explore that direction.

@koaning Got it thanks for the guidance. ill be moving on to it

1 Like