botfront / rasa-addons

A set of πŸš€πŸš€πŸš€ components to be used with Botfront and/or Rasa
https://botfront.io
Apache License 2.0
131 stars 37 forks source link

Unable to get rules.yml working for unexpected intent and entities #18

Closed AsheeshJanda closed 6 years ago

AsheeshJanda commented 6 years ago

I am just a week old in playing around with RASA, so request to bear with me if it seems to be an obvious solution for my issue. I am trying to write some input validations for unexpected user replies(intents) after an action. The documentation of RASA suggests i write a rules.yml file and incorporate the below

from rasa_addons.superagent import SuperAgent agent = SuperAgent.load(...,rules_file='rules.yml')

I have included the rules.yml file and did the above update, However i have a question here.

  1. Do we need to substitute the Agent with SuperAgent in only train_init.py file in rasa_core?. or also in training_online.py?. I have done in train_init.py , However updating same in training_online.py gives me error. The error is because SuperAgent doesn't provide the facility to provision the action_endpoint argument which is required in my case.

as a result of above issue i am unable to perform input validations.Am i missing anything?. Could anyone please help me get this right?.

Regards, Asheesh Janda

znat commented 6 years ago

Hi @AsheeshJanda , rules are only applied at running time, not at training time. Using the rules mean you have to start running your bot with a python script and not with the bash command.

For example with 0.11:

from rasa_core.run import start_server
rom rasa_addons.superagent import SuperAgent
agent = SuperAgent.load(...,  rules_file="rules.yml")
    input_channel = ...
    start_server([input_channel], None, None,5000, agent).serve_forever()
AsheeshJanda commented 6 years ago

Hi @znat thanks for your response. You mean setting up a channel like slack , FB etc will help me get the rules executed ?. I have executed the dialogue management .py with Super agent over the Command line , that doesn't help.

znat commented 6 years ago

Addons work only if Core is started from a python script: https://rasa.com/docs/core/connectors/#id18