The action action_get_instalacoes can usually take around 5 seconds to finish, since it’s making a query to a large amount of data.
Since I don’t want my bot to freeze up for that long, I’d like it to first relay a message saying something like “Okay, i’m making a query” (utter_making_query), before making the actual query (action_get_instalacoes).
Currently, utter_making_query is only outputting after action_get_instalacoes returns.
I’m not sure if Rasa allows this, but basically you’d have to make the custom action run async somehow.
But I fear the underlying problem, at least when using the HTTP api, is that when the user sends a message via HTTP POST, the following bot actions will all be collected into one single JSON and only then returned back as the result of the POST operation - it’s all one atomic process.
I think the rasa shell interface also uses the HTTP endpoint to communicate - so you might have to hack around this.
Maybe let the custom action trigger an async method that will query your data. Meanwhile, the bot only sends back a “One minute, I’m searching the answer”.
Once the query is finished, it can send a trigger/notification to your frontend to pull the result from the action server.
I’m sorry to say the solution wasn’t entirely straightforward.
For other reasons, we decided to remake the custom actions API in nodejs and, eventually, solved this issue by having the API send the utterance to the frontend independently of the rasa server, before calling for the execution of the main action.