Is there a way to not output consecutive actions all at the same time?

Say for example I have a story that follows:

  • action: utter_making_query
  • action: action_make_query

Where action_make_query takes some time to finish.

Currently utter_making_query is only outputting when action_make_query finishes. Is there a way to force it to go through before that?

Can you please elaborate on this. and also share the story

- story: get instalacoes
  steps:
  - intent: get_instalacoes
  - action: utter_making_query
  - action: action_get_instalacoes

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.

@fredericoRocha Did you find a solution for this? I’m facing the same problem right now and can’t seem to find anything on how to actually solve this.

Thanks in advance

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.