Created
August 11, 2018 14:16
-
-
Save imohitmayank/ed8629311e14c5d93acbe48d73179fad to your computer and use it in GitHub Desktop.
rasa_trainer/test_dialog.py
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
# Loading the Agent | |
rasaNLU = RasaNLUInterpreter("models/nlu/default/chat") | |
agent = Agent.load("models/dialogue", interpreter= rasaNLU) | |
# asking question | |
agent.handle_message('Hi') | |
>>> [{'recipient_id': 'default', 'text': 'Hey'}] | |
# once more | |
agent.handle_message('How many days in January') | |
>>> [{'recipient_id': 'default', 'text': 'There are 31 days in the mentioned month.'}] | |
# once more | |
agent.handle_message('How many days in April') | |
>>> [{'recipient_id': 'default', 'text': 'There are 30 days in the mentioned month.'}] | |
# once more | |
agent.handle_message('Bye') | |
>>> [{'recipient_id': 'default', 'text': 'Goodbye'}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment