Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

58 Zeilen
1.7 KiB

  1. # This files contains your custom actions which can be used to run
  2. # custom Python code.
  3. #
  4. # See this guide on how to implement these action:
  5. # https://rasa.com/docs/rasa/custom-actions
  6. # This is a simple example for a custom action which utters "Hello World!"
  7. from typing import Any, Text, Dict, List
  8. from rasa_sdk import Action, Tracker
  9. from rasa_sdk.executor import CollectingDispatcher
  10. from database_connectivity import DataUpdate
  11. import datetime
  12. #
  13. #
  14. # class ActionHelloWorld(Action):
  15. #
  16. # def name(self) -> Text:
  17. # return "action_hello_world"
  18. #
  19. # def run(self, dispatcher: CollectingDispatcher,
  20. # tracker: Tracker,
  21. # domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
  22. #
  23. # dispatcher.utter_message(text="Hello World!")
  24. #
  25. # return []
  26. # class ActionHelloWorld(Action):
  27. # def name(self) -> Text:
  28. # return "action_hello_world"
  29. # def run(self, dispatcher: CollectingDispatcher,
  30. # tracker: Tracker,
  31. # domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
  32. # dispatcher.utter_message(text="Hello World!")
  33. # return []
  34. #FOR DATABASE CONNECTIVITY AND UPDATION.
  35. # class ActionSubmit(Action):
  36. # def name(self) -> Text:
  37. # return "action_submit"
  38. # def run(self, dispatcher: CollectingDispatcher,
  39. # tracker: Tracker,
  40. # domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
  41. # current_time = str(datetime.datetime.now())
  42. # current_time = current_time.split(":")
  43. # current_time = current_time[0] + ":" + current_time[1]
  44. # DataUpdate(tracker.get_slot("name"),tracker.get_slot("email"), current_time, tracker.sender_id)