Skip to content

Instantly share code, notes, and snippets.

@imohitmayank
Created August 11, 2018 14:16
Show Gist options
  • Save imohitmayank/ed8629311e14c5d93acbe48d73179fad to your computer and use it in GitHub Desktop.
Save imohitmayank/ed8629311e14c5d93acbe48d73179fad to your computer and use it in GitHub Desktop.
rasa_trainer/test_dialog.py
# 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