This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
actions.py
44 lines (32 loc) · 1.25 KB
/
actions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/core/actions/#custom-actions/
# This is a simple example for a custom action which utters "Hello World!"
from typing import Any, Text, Dict
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
# class ActionFacilitySearch(Action):
# def name(self) -> Text:
# return "action_facility_search"
# def run(self, dispatcher: CollectingDispatcher,
# tracker: Tracker,
# domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
# facility = tracker.get_slot("facility")
# address = "123 Quarantine Street"
# dispatcher.utter_message(text="Sure, I'm on it!")
# dispatcher.utter_message(text=f"The address is {address}")
# return [SlotSet("address", address)]
class ActionDebugBot(Action):
def name(self) -> Text:
return "action_debug_bot"
def run(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
):
import ipdb
ipdb.set_trace()
dispatcher.utter_message(text="Debug away, captain!")