My scenario is as following. There are 2 custom action classes namely persons and person as below and trying to pass person_name from persons to person.
Action file
class ActionPersons(Action):
def name(self) -> Text:
return "action_persons"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
buttons = []
buttons.append({"title": "Person-1", "payload": "/person"})
buttons.append({"title": "Person-2", "payload": "/person"})
msgStr = "test"
dispatcher.utter_button_message(msgStr,buttons)
return []
class ActionPerson(Action):
def name(self) -> Text:
return "action_person"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
print(tracker.latest_message)
print(tracker.slots)
print(tracker.events)
print(tracker.latest_action_name)
print(tracker.sender_id)
print((tracker.latest_message)['text'])
dispatcher.utter_message("Person name is")
domain file
intents
- persons
- person
actions:
- action_persons
- action_person
slots:
person_name:
type: text
stories.md has following
* persons
- action_persons
* person{"person_name": "kk"}
- action_person
I am unable to pass person name across the custom classes. Let me know how to do it.