I get this error when my bot tries to run my custom action:
DEBUG:rasa_core_sdk.executor:Received request to run 'action_saveSomething'
ERROR:flask.app:Exception on /webhook [POST]**
Traceback (most recent call last):**
File "/Users/ahson/Library/Python/2.7/lib/python/site-packages/rasa_core_sdk/executor.py", line 176, in run
events = action(dispatcher, tracker, domain)
File "actions_custom.py", line 15, in run
response =tracker.latest_message.text
AttributeError: 'dict' object has no attribute 'text'
127.0.0.1 - - [2018-09-10 12:16:27] "POST /webhook HTTP/1.1" 500 412 0.024237
2018-09-10 12:16:27 DEBUG urllib3.connectionpool - http://localhost:5055 "POST /webhook HTTP/1.1" 500 291
2018-09-10 12:16:27 ERROR rasa_core.actions.action - Failed to run custom action 'action_saveSomething'. Action server responded with a non 200 status code of 500.
Make sure your action server properly runs actions and returns a 200 once the action is executed.
Error: 500 Server Error: INTERNAL SERVER ERROR for url: http://localhost:5055/webhook
actions_custom.py:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_core_sdk import Action
from rasa_core_sdk.events import SlotSet
class ActionSaveSlot(Action):
def name(self):
return 'action_saveSomething'
def run(self, dispatcher, tracker, domain):
response =tracker.latest_message.text
return [SlotSet("answer", response)]