Hi All, I am trying to set slot values of type text through my custom action but it is apparently not getting set when that action is run.
Custom action snippet:
class ActionCheckFilePublishName(Action): def name(self): # type: () -> Text return “action_check_file_publish_name”
def run(self, dispatcher, tracker, domain):
mes = (tracker.latest_message)['text']
if "ccla" in mes or "phe" in mes:
SlotSet('file_publish_name_present','set')
dispatcher.utter_template("utter_file_notpublished_1")
return []
else:
SlotSet('file_publish_name_not_present','set')
dispatcher.utter_message('Are you talking about PHE/CCLA file? yes/no')
return []
class ActionFilePublishNextUtteranceMoodConfirm(Action): def name(self): # type: () -> Text return “action_file_publish_next_utterance_mood_confirm”
def run(self, dispatcher, tracker, domain):
name_present = tracker.get_slot('file_publish_name_present')
name_not_present = tracker.get_slot('file_publish_name_not_present')
if name_present is not None:
dispatcher.utter_template("utter_file_notpublished_2")
return[]
if name_not_present is not None:
dispatcher.utter_template("utter_file_notpublished_1")
return[]
else:
dispatcher.utter_message("Sorry, I didn't understand that!")
return
Slot snippet:
slots: file_publish_name_present: type: text file_publish_name_not_present: type: text
But still slot values are none. is there any other way of doing it or am i doing something wrong? Please help