Interactive Training : No registered Action found for name 'action_weather'

(Shammy45) #1

I have a simple custom action, code given below

from future import absolute_import from future import division from future import unicode_literals

from rasa_core.actions.action import Action from rasa_core.events import SlotSet

class ActionWeather(Action): def name(self): return ‘action_weather’

def run(self, dispatcher, tracker, domain):

response = "wether is absolutely fantastic"
dispatcher.utter_message(response)
return [SlotSet('location',loc)]

While running the interactive training , I get this following error message (action.py is stored in a folder called action)

bash-3.2$ python -m rasa_core_sdk.endpoint --actions actions 2019-05-15 20:26:59 INFO main - Starting action endpoint server… 2019-05-15 20:27:10 INFO main - Action endpoint is up and running. on (‘0.0.0.0’, 5055) [2019-05-15 20:28:04,605] ERROR in app: Exception on /webhook [POST] Traceback (most recent call last): File “/Users/admin/anaconda3/lib/python3.7/site-packages/flask/app.py”, line 2292, in wsgi_app response = self.full_dispatch_request() File “/Users/admin/anaconda3/lib/python3.7/site-packages/flask/app.py”, line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File “/Users/admin/anaconda3/lib/python3.7/site-packages/flask_cors/extension.py”, line 161, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) File “/Users/admin/anaconda3/lib/python3.7/site-packages/flask/app.py”, line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File “/Users/admin/anaconda3/lib/python3.7/site-packages/flask/_compat.py”, line 35, in reraise raise value File “/Users/admin/anaconda3/lib/python3.7/site-packages/flask/app.py”, line 1813, in full_dispatch_request rv = self.dispatch_request() File “/Users/admin/anaconda3/lib/python3.7/site-packages/flask/app.py”, line 1799, in dispatch_request return self.view_functionsrule.endpoint File “/Users/admin/anaconda3/lib/python3.7/site-packages/flask_cors/decorator.py”, line 128, in wrapped_function resp = make_response(f(*args, **kwargs)) File “/Users/admin/anaconda3/lib/python3.7/site-packages/rasa_core_sdk/endpoint.py”, line 59, in webhook response = executor.run(action_call) File “/Users/admin/anaconda3/lib/python3.7/site-packages/rasa_core_sdk/executor.py”, line 177, in run “No registered Action found for name ‘{}’.”.format(action_name) Exception: No registered Action found for name ‘action_weather’.

(Shammy45) #2

By changing the package it got fixed from rasa_core_sdk import Action from rasa_core_sdk.events import SlotSet