How to use the events caused by a custom action, to be shown as a reply from the bot in the conversation?

rasa-core

(Arghya Ganguly) #1

I have a custom action where i am querying a mysql database and fill the slots based on the retrieval query. The tracker got updated with the fetched values of the respective slots.(current tracker state)

2019-02-11 16:01:54 DEBUG rasa_core.processor - Received user message ‘yes’ with intent ‘{‘name’: ‘mood_affirm’, ‘confidence’: 0.7875545623995659}’ and entities ‘[]’ 2019-02-11 16:01:54 DEBUG rasa_core.processor - Logged UserUtterance - tracker now has 46 events 2019-02-11 16:01:54 DEBUG rasa_core.processor - Current slot values: PERSON: Arghya battery: 2500 mAh,Li-Polymer camera: 8GB customer_location: None display: 42.2 Ghz Kyro model: f10 operating_system: 6 in price: None processor: 26001800 pixels,25fps shop_location: None workshop_location: None 2019-02-11 16:01:54 DEBUG rasa_core.policies.memoization - Current tracker state [{‘slot_battery_0’: 1.0, ‘slot_PERSON_0’: 1.0, ‘intent_OPPO_Phones_Price’: 1.0, ‘slot_display_0’: 1.0, ‘slot_operating_system_0’: 1.0, ‘slot_processor_0’: 1.0, ‘entity_model’: 1.0, ‘prev_utter_model_name_lookout’: 1.0, ‘slot_camera_0’: 1.0, ‘slot_model_0’: 1.0}, {‘slot_battery_0’: 1.0, ‘intent_model_name_lookout’: 1.0, ‘slot_PERSON_0’: 1.0, ‘slot_display_0’: 1.0, ‘slot_operating_system_0’: 1.0, ‘slot_processor_0’: 1.0, ‘entity_model’: 1.0, ‘prev_action_listen’: 1.0, ‘slot_camera_0’: 1.0, ‘slot_model_0’: 1.0}, {‘slot_battery_0’: 1.0, ‘intent_model_name_lookout’: 1.0, ‘slot_PERSON_0’: 1.0, ‘slot_display_0’: 1.0, ‘slot_operating_system_0’: 1.0, ‘prev_action_save_model_name’: 1.0, ‘slot_processor_0’: 1.0, ‘entity_model’: 1.0, ‘slot_camera_0’: 1.0, ‘slot_model_0’: 1.0}, {‘slot_battery_0’: 1.0, ‘intent_model_name_lookout’: 1.0, ‘prev_utter_model_name_confirm’: 1.0, ‘slot_PERSON_0’: 1.0, ‘slot_display_0’: 1.0, ‘slot_operating_system_0’: 1.0, ‘slot_processor_0’: 1.0, ‘entity_model’: 1.0, ‘slot_camera_0’: 1.0, ‘slot_model_0’: 1.0}, {‘slot_battery_0’: 1.0, ‘slot_PERSON_0’: 1.0, ‘slot_display_0’: 1.0, ‘slot_operating_system_0’: 1.0, ‘intent_mood_affirm’: 1.0, ‘slot_processor_0’: 1.0, ‘slot_camera_0’: 1.0, ‘slot_model_0’: 1.0, ‘prev_action_listen’: 1.0}]

How to reflect the same slot values during the conversation as a reply to the question asked by the user to the bot? Or will the slots get automatically reflected/shown with the updated values in the conversation.


(Arghya Ganguly) #2

Figured it out eventually. Just passing the slot values inside dispatcher.utter_message deals with it.