Skip to content

Instantly share code, notes, and snippets.

@nahidalam
Created September 30, 2018 05:12
Show Gist options
  • Save nahidalam/237e8d285c5f80c8e275cfc1593240a4 to your computer and use it in GitHub Desktop.
Save nahidalam/237e8d285c5f80c8e275cfc1593240a4 to your computer and use it in GitHub Desktop.
How to implement actions in Rasa
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