In an action, dispatcher.utter_template does not utter the template immediately. It only dispatches at the end of the action. How can I force the bot to say a utter before the action is complete?
The reason why I want to force the bot to say something right away is that I want it to say something while it is calling an external API (which takes a while). In this way, the user at least has some feedback that the bot received a message
So you basically first perform an action to utter that the following request might take a while and then the actual action is performed. Does that work for you?
Couldnât that be a solution to use inside an action before actually executing the long running function if someone doesnât want to model the case inside the stories? I am asking because I didnât try that function yet but it may become important.
Ok so basically I tried with the Callback input but Iâm not receiving the first message (âletâs see what optionsâŚâ) in my application. I think the reason is because it is creating a tracker. How do I avoid this?
Creating a new tracker for id 'default'.
2019-11-08 12:15:18 DEBUG rasa.core.tracker_store - Recreating tracker for id 'default'
2019-11-08 12:15:18 DEBUG rasa.core.processor - Action 'utter_options_available' ended with events '['BotUttered(text: Let\'s see what options we have available, data: {"elements": null, "quick_replies": null, "buttons": null, "attachment": "default", "image": "default", "custom": null}, metadata: {})']'
2019-11-08 12:15:18 DEBUG rasa.core.lock_store - Deleted lock for conversation 'default'.
2019-11-08 12:15:18 DEBUG rasa.core.tracker_store - Recreating tracker for id 'default'
2019-11-08 12:15:20 DEBUG rasa.core.processor - Action 'book_form' ended with events '['BotUttered(text: (....)']'
My application receives bot message by sending a post request to rasa with the user message.
If there is no tracker yet, Rasa will create one. This is a normal process. We need the tracker to keep track of all the incoming and outgoing messages.
Is there any error? Can you please paste the full log here?
2019-11-12 10:15:47 DEBUG rasa.core.policies.memoization - Current tracker state [None, None, None, {}, {'intent_book': 1.0, 'prev_action_listen': 1.0, 'entity_location': 1.0}]
2019-11-12 10:15:47 DEBUG rasa.core.policies.memoization - There is no memorised next action
2019-11-12 10:15:47 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, 'give_cabin_class'.
2019-11-12 10:15:47 DEBUG rasa.core.policies.form_policy - There is an active form 'book_form'
2019-11-12 10:15:47 DEBUG rasa.core.policies.two_stage_fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.3).
2019-11-12 10:15:47 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_3_FormPolicy
2019-11-12 10:15:47 DEBUG rasa.core.processor - Predicted next action 'action_listen' with confidence 1.00.
2019-11-12 10:15:47 DEBUG rasa.core.processor - Action 'action_listen' ended with events '[]'
2019-11-12 10:15:47 DEBUG rasa.core.lock_store - Deleted lock for conversation '123'.
2019-11-12 10:15:53 DEBUG rasa.core.tracker_store - Recreating tracker for id '123'
2019-11-12 10:15:53 WARNING root - Could not parse timestamp 6bd9a488f5eb4e6eb0fb89a86a7026e7. Instead current UTC time will be passed to duckling. Error: invalid literal for int() with base 10: '6bd9a488f5eb4e6eb0fb89a86a7026e7'
2019-11-12 10:15:53 DEBUG rasa.core.processor - Received user message 'arrive faster' with intent '{'name': 'arrive_fast', 'confidence': 0.9331502318382263}' and entities '[]'
2019-11-12 10:15:53 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 101 events
2019-11-12 10:15:53 DEBUG rasa.core.policies.memoization - Current tracker state [None, None, None, {}, {'intent_book': 1.0, 'prev_action_listen': 1.0, 'entity_location': 1.0}]
2019-11-12 10:15:53 DEBUG rasa.core.policies.memoization - There is no memorised next action
2019-11-12 10:15:53 DEBUG rasa.core.policies.form_policy - There is an active form 'book_form'
2019-11-12 10:15:53 DEBUG rasa.core.policies.two_stage_fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.3).
2019-11-12 10:15:53 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_3_FormPolicy
2019-11-12 10:15:53 DEBUG rasa.core.processor - Predicted next action 'book_form' with confidence 1.00.
2019-11-12 10:15:53 DEBUG rasa.core.actions.action - Calling action endpoint to run action 'book_form'.
2019-11-12 10:15:53 DEBUG rasa.core.tracker_store - Creating a new tracker for id 'default'.
2019-11-12 10:15:53 DEBUG rasa.core.tracker_store - Recreating tracker for id 'default'
2019-11-12 10:15:53 DEBUG rasa.core.processor - Action 'utter_options_available' ended with events '['BotUttered(text: Let\'s see what options we have available, data: {"elements": null, "quick_replies": null, "buttons": null, "attachment": "default", "image": "default", "custom": null}, metadata: {})']'
2019-11-12 10:15:53 DEBUG rasa.core.lock_store - Deleted lock for conversation 'default'.
2019-11-12 10:15:53 DEBUG rasa.core.tracker_store - Recreating tracker for id 'default'
2019-11-12 10:15:56 DEBUG rasa.core.processor - Action 'book__form' ended with events '['BotUttered(text: .........']'
This is the only time in the middle of the conversation where it creates a new tracker.
2019-11-14 14:13:48 DEBUG rasa.core.lock_store - Failed to acquire lock for conversation ID â123â. RetryingâŚ
2019-11-14 14:13:49 DEBUG rasa.core.lock_store - Failed to acquire lock for conversation ID â123â. RetryingâŚ
This error makes sense. You cannot modify a conversation (by sending a message to the user) when you are currently already modifying the same conversation (through the custom action). Same as @Tanja Iâd suggest to
split your actions or
run the api request asynchronously and return the âmessage receivedâ notification with the custom action
@Tobias_Wochinger
ârun the api request asynchronously and return the âmessage receivedâ notification with the custom actionâ -> how/where do I return the message notification with the custom action? In my backend application or in rasa itself?