Created
September 30, 2018 05:12
-
-
Save nahidalam/237e8d285c5f80c8e275cfc1593240a4 to your computer and use it in GitHub Desktop.
How to implement actions in Rasa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActionOrderProduct(Action): | |
def name(self): | |
return 'action_order_product' | |
def run(self, dispatcher, tracker, domain): | |
router = tracker.get_slot('router') | |
confirmationNumber = 123456 #later generate through some process | |
response = """Your product {} is ordered for you. It will be shipped to your address. Your confirmation number is {}""".format(router, confirmationNumber) | |
dispatcher.utter_message(response) | |
return [SlotSet('router',router)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment