Açıklama Yok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

actions.py 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. from typing import Any, Text, Dict, List
  2. from rasa_sdk import Action, Tracker
  3. from rasa_sdk.executor import CollectingDispatcher
  4. from flask import request
  5. import json
  6. class ActionService(Action):
  7. def name(self) -> Text:
  8. return "action_service"
  9. def run(self, dispatcher: CollectingDispatcher,
  10. tracker: Tracker,
  11. domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
  12. buttons=[
  13. {"payload":'/satisfied',"title":"yes"},
  14. {"payload":'/notsatisfied',"title":"no"},
  15. ]
  16. dispatcher.utter_message(text="Are you satisfied with above solution",buttons=buttons)
  17. return []
  18. class action_support_service(Action):
  19. def name(self) -> Text:
  20. return "action_support_service"
  21. def run(self, dispatcher: CollectingDispatcher,
  22. tracker: Tracker,
  23. domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
  24. buttons=[
  25. {"payload":'/connect_support',"title":"yes"},
  26. {"payload":'/noconnect_support',"title":"no"},
  27. ]
  28. dispatcher.utter_message(text="do you want me to connect to support team",buttons=buttons)
  29. return []