Encountered an exception while running action 'wfh_request_form'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code

Here is my actions.py:

from typing import Any, Text, Dict, List from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher from rasa_sdk.forms import FormAction

class Wfh_Request_Form(FormAction): def name(self) -> Text: return “wfh_request_form”

@staticmethod
def required_slots(tracker:Tracker) ->List[Text]:
	return ["name","email"]
def submit(self):
	dispacter.utter_template('utter_submit',tracker)
	return []

Here is my domain.yml:

%YAML 1.1

actions:

  • utter_attendance
  • utter_cheer_up
  • utter_did_that_help
  • utter_goodbye
  • utter_greet
  • utter_happy
  • utter_leave
  • utter_leave_history
  • utter_leave_policy
  • utter_wfh_policy
  • utter_wfh_request
  • utter_name
  • utter_email entities:
  • year
  • name
  • email slots: name: type: unfeaturized auto_fill: false email: type: unfeaturized auto_fill: false requested_slot: type: unfeaturized intents:
  • marking_attendance
  • greet
  • goodbye
  • affirm
  • deny
  • mood_great
  • mood_unhappy
  • leave_status
  • leave_history
  • leave_policy
  • wfh_policy
  • wfh_request

templates: utter_attendance:

  • text: Please tell the details of the employee utter_cheer_up:
  • image: https://i.imgur.com/nGF1K8f.jpg text: ‘Here is something to cheer you up:’ utter_did_that_help:
  • text: Did that help you? utter_goodbye:
  • text: Bye utter_greet:
  • text: Hey! How are you? utter_happy:
  • text: Great carry on! utter_leave:
  • text: I’ll show you the leave status utter_leave_history:
  • text: 'the leave history for this financial year is ’ utter_leave_policy:
  • text: i will show the leave policy utter_wfh_policy:
  • text: i will show the work from home policy utter_wfh_request:
  • text: Ok now please enter your details utter_name:
  • text: Please enter your name utter_email:
  • text: Please enter your email utter_submit:
  • text: ‘Name: {name} \n email: {email}’

forms:

  • wfh_request_form

Here is my config.yml:

Configuration for Rasa NLU.

Components

language: en pipeline: supervised_embeddings

Configuration for Rasa Core.

Policies

policies:

  • name: MemoizationPolicy
  • name: KerasPolicy
  • name: MappingPolicy
  • name: FormPolicy

Can someone please help ?

From what I can tell you seem to be missing a definition of utter_submit. Please fix the formatting of the action.py you posted. It might be helpful for you to have a look at our form example on github rasa/examples/formbot at master · RasaHQ/rasa · GitHub

domain.yml (1.5 KB)

I changed my domain.yml file after your suggestion but the error is still not resolved. And I even tried running the official example but the same error is encountered.

Sorry for taking so long to get back to you. If you are encountering the error with the standard example, are you running the rasa action server?

I tried running the official example according to the readme instructions but the bot is not able to utter slot values after the conversation. And when I tried rasa interactive it throws the same error. Can you please try run this example rasa/examples/formbot at master · RasaHQ/rasa · GitHub

What I meant is the rasa action server, it is the command rasa run actions, forgetting this command can lead to the same error. However I do indeed have get the same error message when running the example in interactive learning. I will look into this and get back to you when I find the problem.

There was an error when running interactive learning in the example because IL did not default to using endpoints.yml if --endpoints option was not specified. This has been fixed and the example works now. Trying running your bot with the latest version from github or try with version 1.1.5, which should be available through pip within the next couple of days.

Whenever I load the bot to the shell and input the following commands, the slot values are not filled correctly. Can you look at the conversation below and tell me what I am doing wrong here?

2019-07-11 22:53:48.729007: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): , Bot loaded. Type a message and press enter (use ‘/stop’ to exit): Your input -> i want to search a restaurant

what cuisine?

Your input -> indian

how many people?

Your input -> 5

do you want to seat outside?

Your input -> no

please provide additional preferences

Your input -> no additional preferences

please give your feedback on your experience so far

Your input -> excellent

All done! sorry, I didn’t understand you, please try input something else

Your input ->

What do you mean specifically the slots are not being filled correctly? From the convseration you posted I can’t tell what your problem is.