Hi I’m working on a project and I need bot to ask the user for entity i.e. Incident number in between a custom action.
Then user will provide the incident number, and for that incident number bot will get output from SQL and give it as a bot response. I just need help with the bot asking the incident number in between custom action. Please help !!
Here is my action file class ActionMedicalNecessity(Action):
def name(self) -> Text:
return "action_necessity"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
incident_no = tracker.get_slot("incident_no")
# reason is fetched from sql and is stored in 'reason' variable
reason = 'xyz'
bot_response = " For {} incident number the medical necessity reason is {}".format(incident_no, reason)
dispatcher.utter_message(text=bot_response)
return [SlotSet('incident_no', incident_no)]
and here is my story
## medical necessity path
* medical_necessity
- action_necessity
- slot{"incident_no":101}
- slot{"incident_no":102}
- slot{"incident_no":103}
- slot{"incident_no":104}