-
Notifications
You must be signed in to change notification settings - Fork 0
/
actions.py
34 lines (18 loc) · 881 Bytes
/
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
# 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, List
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa.core.events import UserUtteranceReverted
class ActionGreetUser(Action):
def name(self) -> Text:
return "action_greet_user"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
dispatcher.utter_message(text="Hi, I'm nuSDKBot, i can help you to get the information about nuSDK API, please ask me!")
return [UserUtteranceReverted()]