Rasa core API are POST api’s.
They give response only when executed.
Now, when user is asking some question and i need to do some heavy task for the user’s
query after intent classification,i need to display “Please wait” to the end user.
How can we achieve this?
Do we need to handle this at the UI end?
Ex:-
Bot: HI, How can I help you?
User:Where is this order 3423423?
Bot: Let me check
–after this step there is a time gap as i need to do heavy form actions,calling various API’s etc etc.
Bot: Your order has been shipped already
I did that but the we get that message as well as the action response message together when api call is made.
because i am making rasa api call from UI i get all the message at the same time.
@aniket is it the form action that performs the long running action? Could you show me where in the code you send the message to the user at the moment?
I’m trying to implement that scenario but even if I’ve broken the “please wait” message from the long running action I still receive the information all together on the web UI
This is the submit Form method:
def submit(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]:
# Retrieve slot values
udc_number = tracker.get_slot('udc_number')
informative_system = tracker.get_slot('informative_system')
dispatcher.utter_message(template="utter_please_wait")
# I've tried to use this but it's the same
#tracker.trigger_followup_action('action_call_custom_api')
# Then I've tried to return a FollowupAction
return [SlotSet("udc_number", udc_number),
SlotSet("informative_system", informative_system),
FollowupAction('action_call_custom_api')]
I’ve been having the same issue. I’m using “dispatcher.utter_message(response=“utter_wait_message”)” in a separeted action. But in the UI, I only get the messages all together (after making the request to an API)… Could someone please help me out?