Hey everyone I am getting an error when I try to execute my ActionForm
This is my error message:
ERROR rasa_sdk.endpoint - Exception on /webhook [POST]
Traceback (most recent call last): File “/home/vphrase/Desktop/chatbot/chat_bot/lib/python3.6/site-packages/flask/app.py”, line 2446, in wsgi_app response = self.full_dispatch_request() File “/home/vphrase/Desktop/chatbot/chat_bot/lib/python3.6/site-packages/flask/app.py”, line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File “/home/vphrase/Desktop/chatbot/chat_bot/lib/python3.6/site-packages/flask_cors/extension.py”, line 161, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) File “/home/vphrase/Desktop/chatbot/chat_bot/lib/python3.6/site-packages/flask/app.py”, line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File “/home/vphrase/Desktop/chatbot/chat_bot/lib/python3.6/site-packages/flask/_compat.py”, line 39, in reraise raise value File “/home/vphrase/Desktop/chatbot/chat_bot/lib/python3.6/site-packages/flask/app.py”, line 1949, in full_dispatch_request rv = self.dispatch_request() File “/home/vphrase/Desktop/chatbot/chat_bot/lib/python3.6/site-packages/flask/app.py”, line 1935, in dispatch_request return self.view_functionsrule.endpoint File “/home/vphrase/Desktop/chatbot/chat_bot/lib/python3.6/site-packages/flask_cors/decorator.py”, line 128, in wrapped_function resp = make_response(f(*args, **kwargs)) File “/home/vphrase/Desktop/chatbot/chat_bot/lib/python3.6/site-packages/rasa_sdk/endpoint.py”, line 59, in webhook response = executor.run(action_call) File “/home/vphrase/Desktop/chatbot/chat_bot/lib/python3.6/site-packages/rasa_sdk/executor.py”, line 245, in run events = action(dispatcher, tracker, domain) File “/home/vphrase/Desktop/chatbot/chat_bot/lib/python3.6/site-packages/rasa_sdk/forms.py”, line 528, in run events = self._activate_if_required(dispatcher, tracker, domain) File “/home/vphrase/Desktop/chatbot/chat_bot/lib/python3.6/site-packages/rasa_sdk/forms.py”, line 474, in _activate_if_required for slot_name in self.required_slots(tracker):
TypeError: required_slots() takes 1 positional argument but 2 were given
My Custom FormAction:
`class ExplorazorForm(FormAction):
def name(self):
return 'explorazor_form'
def required_slots(tracker):
"""A list of required slots that the form has to fill"""
if tracker.latest_message['intent'].get('name') == "get_email":
return ['email', 'target_col', 'dimension']
else:
return ['target_col', 'dimension']
def submit(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict]:
"""Define what the form has to do after all required slots are filled"""
# utter submit template
dispatcher.utter_template("utter_submit", tracker)
return []
`
Please help me out here.