简体   繁体   中英

Rasa Core - Can not access action templateName, as that name is not a registered action for this domain

I am building my first chat bot using Rasa NLU and Rasa Core in Python 3.6.7

Everything was working well. I added few new utterances in the templates section of the domain file and wrote some stories to use these utterances. Now none of the new template is working and training the model produces the following error:

File "dialogue_management_model.py", line 46, in <module>
    train_dialogue()
  File "dialogue_management_model.py", line 31, in train_dialogue
    augmentation_factor = 50)
  File "/home/pprasai/anaconda3/envs/nluenv/lib/python3.6/site-packages/rasa_core/agent.py", line 268, in train
    **kwargs)
  File "/home/pprasai/anaconda3/envs/nluenv/lib/python3.6/site-packages/rasa_core/policies/ensemble.py", line 72, in train
    policy.train(training_trackers, domain, **kwargs)
  File "/home/pprasai/anaconda3/envs/nluenv/lib/python3.6/site-packages/rasa_core/policies/memoization.py", line 152, in train
    self._add(trackers_as_states, trackers_as_actions, domain)
  File "/home/pprasai/anaconda3/envs/nluenv/lib/python3.6/site-packages/rasa_core/policies/memoization.py", line 108, in _add
    feature_item = domain.index_for_action(action)
  File "/home/pprasai/anaconda3/envs/nluenv/lib/python3.6/site-packages/rasa_core/domain.py", line 151, in index_for_action
    self._raise_action_not_found_exception(action_name)
  File "/home/pprasai/anaconda3/envs/nluenv/lib/python3.6/site-packages/rasa_core/domain.py", line 159, in _raise_action_not_found_exception
    "Available actions are: \n{}".format(action_name, actions))
Exception: Can not access action 'utter_ask_email_send', as that name is not a registered action for this domain. Available actions are: 
     - action_check_ao
     - action_default_fallback
     - action_listen
     - action_restart
     - action_restaurant
     - action_send_mail
     - utter_ask_budget
     - utter_ask_cuisine
     - utter_ask_howcanhelp
     - utter_ask_location
     - utter_default
     - utter_goodbye
     - utter_greet
     - utter_unsupported_city

The new templates I created are not shown in this list. Following is an excerpt of my templates:

templates: 
  utter_sending_email: 
    - "An email is being sent."
  utter_ask_email_send: 
    - "Would you like me to send you an email with details?"
  utter_ask_email_address: 
    - "Could you please tell me your email address?"
  utter_invalid_email: 
    - "It seems you might have entered an invalid email. Would you like to try again?"
  utter_greet: 
    - "hey there! How may i help you"
    - "Hi, How can I help you!"
    - "Hey, How is it going. How May I help you Today"
  utter_goodbye: 
    - "goodbye :("
    - "Bye-bye"
  utter_default: 
    - "I could not process you last query. I am terribly sorry."

And here's how I use these in the stories file:

* greet
    - utter_greet
* restaurant_search
    - utter_ask_location
* restaurant_search{"location": "tokyo", "cuisine": "chinese"}
    - slot{"location": "tokyo"}
    - slot{"cuisine": "chinese"}
    - utter_ask_budget
* restaurant_search{"budget": "economy"}
    - slot{"budget": "ecnnomy"}
    - action_search_restaurant
    - utter_ask_email_send
* small_talk
    - utter_sending_email
    - utter_invalid_email
* deny
    - utter_goodbye

I am using Rasa Core version 0.10.1 . Can anyone kindly help me figure this out?

NOTE Removing stories with the new templates will resolve the error and the training will run successfully. So I think the error must be in either stories file or the domain file.

It was very stupid of me. I did not mention the new templates under actions section of my domail.yml file. Adding utter_ask_email_send under actions section solved the problem. Perhaps now I'll never forget.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM