NameError: name 'FormAction' is not defined when running actions.py

Hi, I’m trying to implement a form action, so my actions.py looks like this:

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


class BeratungForm(FormAction):

   def name(self) -> Text:
       return "beratung_form"

   [followed by some functions]

But when I try to run the actions.py in my terminal with

rasa run actions

I get a long stacktrace with the error

File "/home/sugarshock/bildungsbot-ai/actions.py", line 29, in <module>
      class BeratungForm(FormAction):
NameError: name 'FormAction' is not defined

at the bottom. I couldn’t find any more recent information on how to implement the form action other than this tutorial.

Does anybody have an idea what’S the problem?

1 Like

Hi @sugarshock

You forget to include from rasa_sdk.forms import FormAction in your actions.py

1 Like