If I need to write any function like for example “Date and Time” then how should I write custom function and how to match details in all the files like nlu,domain and stories.
I know how to write normal functions but I didn’t get clarity how write functions and link the function with different files. I tried it but I’m getting error.
class DateTime(Action):
def name(self) -> Text:
return "action_date_time"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
date = datetime.now().date()
time = datetime.now().time()
print("Today's Date: ",date,"and Time: ",time)
dispatcher.utter_message(template='utter_datetime')
return []