Rasa version : Rasa 1.1.4
Python version : Python 3.7.3 (anaconda)
Operating system : windows
Issue : customs action not working
Error (including full traceback) :
2019-08-14 12:38:22 ERROR rasa.core.processor - Encountered an exception while running action 'action_custom'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.
Command or request that led to error :
i ran rasa interactive mode and called action_custom which is supposed to send back a simple response defined by utter_message. I tried using dispatcher.utter_template.
Content of configuration file (config.yml):
pipeline:
- name: "WhitespaceTokenizer"
- name: "RegexFeaturizer"
- name: "CRFEntityExtractor"
- name: "EntitySynonymMapper"
- name: "CountVectorsFeaturizer"
- name: "EmbeddingIntentClassifier"
intent_tokenization_flag: true
intent_split_symbol: "+"
policies:
- name: "KerasPolicy"
epochs: 300
featurizer:
- name: MaxHistoryTrackerFeaturizer
max_history: 5
state_featurizer:
- name: BinarySingleStateFeaturizer
- name: "MemoizationPolicy"
max_history: 5
- name: "FallbackPolicy"
nlu_threshold: 0.4
core_threshold: 0.3
fallback_action_name: "action_default_fallback"
Content of domain file (domain.yml):
intents:
- answer_contact_details
- answer_reports
- answer_suffer_for
- answer_time
- greetings
- treatment
- bye
- ask_cost
slots:
treatment_name:
type: text
relation:
type: text
treatment_type:
type: categorical
values:
- modern
- ayurveda
entities:
- treatment_name
- treatment_type
- relation
actions:
- action_custom
- utter_treatment_not_available
- utter_greetings
- utter_what_treatment
- utter_howlong_suffer
- utter_ask_reports
- utter_thank_for_reports
- utter_ask_contact_details
- utter_thanks_for_contact_details
- utter_you_receive_call
- utter_time
- utter_bye
- utter_default
- utter_message
templates:
utter_greetings:
- text: "Hi , I am AVA.Welcome to INDHEAL."
utter_what_treatment:
- text: "What treatment are you looking for?"
utter_treatment_not_available:
- text: "sorry, this treatment isn't available"
utter_howlong_suffer:
- text: "could you please tell me how long the problem has persisted?"
utter_ask_reports:
- text: "Okay. Do you have the following reports?"
utter_ask_contact_details:
- text: "Could you please share your contact details?"
utter_thanks_for_contact_details:
- text: "Thanks for sharing your contact details."
utter_thank_for_reports:
- text: "Thank you for sharing the reports."
utter_time:
- text: "Thank you for sharing your details. When would be a comfortable time to contact you?"
utter_you_receive_call:
- text: "you will receive a call from us. Thank you"
utter_bye:
- text: "Thank you for contacting INDHEAL! We will get in touch soon."
utter_default:
- text: "sorry, could u please rephrase that..."
utter_message:
- text: "successful actions connection!"
content of endpoints.yml:
url: "http://localhost:5055/webhook"
content of actions.py:
from __future__ import unicode_literals
from rasa_core_sdk import Action
#from rasa_sdk.action import Action
from rasa_core_sdk.events import SlotSet
#import mysql.connector
'''class ActionMessage(Action):
def name(self):
return "action_message"
def run(self,dispatcher,tracker,domain):
response="hey here is your message"
dispatcher.utter_message(response)
return []'''
class ActionCustom(Action):
def name(self):
return "action_custom"
def run(self,dispatcher,tracker,domain):
dispatcher.utter_template("utter_message",tracker)
return []
command used to run the server: python -m rasa_core_sdk.endpoint --actions actions (i havent used "action_custom in my stories but i was trying to see if it worked in rasa interactive mode and i was getting the error above.)
output of running " rasa interactive --debug":
Could someone please help me, I don’t understand where I am going wrong. Thank you