Can you please help on this

ActionNotFoundException: Cannot access action ‘lead_form_p1’, as that name is not a registered action for this domain. Available actions are: * - action_listen

  •      - action_restart
    
  •      - action_session_start
    
  •      - action_default_fallback
    
  •      - action_deactivate_loop
    
  •      - action_revert_fallback_events
    
  •      - action_default_ask_affirmation
    
  •      - action_default_ask_rephrase
    
  •      - action_two_stage_fallback
    
  •      - action_back
    
  •      - ...
    
  •      - utter_greet
    
  •      - utter_menu
    
  •      - utter_urlAvailable
    
  •      - utter_lead_q1
    
  •      - utter_lead_q2
    
  •      - utter_lead_q3
    
  •      - utter_lead_q4
    
  •      - utter_lead_q5
    
  •      - utter_goodbye
    
  •      - utter_bot_challenge
    
  •      - utter_ask_budget
    
  •      - utter_ask_email
    
  •      - utter_ask_mockup
    
  •      - utter_ask_name
    
  •      - utter_ask_phone
    
  •      - utter_ask_requirement
    
  •      - utter_ask_timeline
    
  •      - utter_ask_url

Hi @darpant-289

Is lead_form_p1 , a form action ?

If so, ensure it is mentioned under forms: section in your domain.yml.

yes but still shows the error:

@darpant-289

Which version of rasa are you using ? Also share me your domain & actions file to have a deeper look.

yes domain file:

version: “2.0”

intents:

  • greet

  • goodbye

  • reject

  • begin_lead

  • accept

  • bot_challenge

slots:

requirement:

type: text

influence_conversation: false

mockup:

type: text

influence_conversation: false

url:

type: text

influence_conversation: false

timeline:

type: text

influence_conversation: false

budget:

type: text

influence_conversation: false

name:

type: text

influence_conversation: false

email:

type: text

influence_conversation: false

phone:

type: text  

influence_conversation: false

responses:

utter_greet:

  • text: “Hi! I am John from Cedex Technologies LLP. We provide high quality and cost-effective Web, Mobile, Chatbot and Voicebot solutions.”

utter_menu:

  • text: “What are you looking for today?”

    buttons:

    • title: “Web Application Development”

      payload: “/begin_lead”

    • title: “Mobile App Development”

      payload: “/begin_lead”

    • title: “Chatbot Development”

      payload: “/begin_lead”

    • title: “Frontend Development”

      payload: “/begin_lead”

    • title: “Progessive Web App Development”

      payload: “/begin_lead”

    • title: “AI & Machine Learning”

      payload: “/begin_lead”

utter_lead_q1:

  • text: “Great. We have developed more than 100+ web applications till date!”

utter_ask_requirement:

  • text: “Can you share some brief description of your requirements?”

utter_ask_mockup:

  • text: “Alright! \n\nDo you have any of the following ready?”

    buttons:

    • title: “Wireframes”

      payload: “Wireframes”

    • title: “Designs”

      payload: “Designs”

    • title: “RFP or any Document”

      payload: “RFP or any Document”

    • title: “None”

      payload: “None”

utter_urlAvailable:

  • text: “Is there any URL that you would like to share for our reference?”

    buttons:

    • title: “Yes”

      payload: “yes”

    • title: “No”

      payload: “no”

utter_ask_url:

  • text: “Could you please share the URL with us?”

utter_ask_timeline:

  • text: “When do you plan to enter development with this project?”

    buttons:

    • title: “Immediately”

      payload: “Immediately”

    • title: “within a month”

      payload: “within a month”

    • title: “within the next 3 months”

      payload: “within the next 3 months”

    • title: “after 3 months”

      payload: “after 3 months”

utter_ask_budget:

  • text: “Great!\n\nWhat is your earmarked budget for this project?”

    buttons:

    • title: “Below $5000”

      payload: “Below $5000”

    • title: “$5000 - $15000”

      payload: “$5000 - $15000”

    • title: “$15000 - $25000”

      payload: “$15000 - $25000”

    • title: “$25000 and above”

      payload: “$25000 and above”

utter_ask_name:

  • text: “Great. May I know your name please?”

utter_ask_email:

  • text: “Can you please share your email ID? Trust us, we will never spam!”

utter_ask_phone:

  • text: “Can I have your phone number”

utter_lead_q2:

  • text: “Thanks for answering all our questions and being this patient. We appreciate it!”

utter_lead_q3:

  • text: "Here is your data: \n

         - requirement: {requirement}\n
    
         - mockup: {mockup}\n
    
         - url: {url}\n
    
         - timeline: {timeline}\n
    
         - budget: {budget}\n
    
         - name: {name}\n
    
         - email: {email}\n
    
         - phone: {phone}"
    

utter_lead_q4:

  • text: “I will have our Business Experts get in touch with you soon, to make your project a reality!”

utter_lead_q5:

  • text: “In the meanwhile for anything, you can contact us at sales@cedextech.com or +91 888 999 9999”

utter_goodbye:

  • text: “Thank you. Have a nice day.”

utter_bot_challenge:

  • text: “Sorry can’t understand it.”

session_config:

session_expiration_time: 60

carry_over_slots_to_new_session: true

actions:

  • utter_greet

  • utter_menu

  • utter_urlAvailable

  • utter_lead_q1

  • utter_lead_q2

  • utter_lead_q3

  • utter_lead_q4

  • utter_lead_q5

  • utter_goodbye

  • utter_bot_challenge

FormAction:

lead_form_p1:

requirement:

  - type: from_entity 

  - entity: requirement

mockup:

  - type: from_entity

  - entity: mockup

lead_form_p2:

url:

  - type: from_entity

  - entity: url

lead_form_p3:

timeline:

 - type: from_entity

 - entity: timeline

budget:

 - type: from_entity

 - entity: budget

name:

 - type: from_entity

 - entity: name

email:

 - type: from_entity

 - entity: email

phone:

 - type: from_entity

 - entity: phoneversion: "2.0"

intents:

  • greet
  • goodbye
  • reject
  • begin_lead
  • accept
  • bot_challenge

slots: requirement: type: text influence_conversation: false mockup: type: text influence_conversation: false url: type: text influence_conversation: false timeline: type: text influence_conversation: false budget: type: text influence_conversation: false name: type: text influence_conversation: false email: type: text influence_conversation: false phone: type: text
influence_conversation: false

responses: utter_greet:

  • text: “Hi! I am John from Cedex Technologies LLP. We provide high quality and cost-effective Web, Mobile, Chatbot and Voicebot solutions.”

utter_menu:

  • text: “What are you looking for today?” buttons:
    • title: “Web Application Development” payload: “/begin_lead”
    • title: “Mobile App Development” payload: “/begin_lead”
    • title: “Chatbot Development” payload: “/begin_lead”
    • title: “Frontend Development” payload: “/begin_lead”
    • title: “Progessive Web App Development” payload: “/begin_lead”
    • title: “AI & Machine Learning” payload: “/begin_lead”

utter_lead_q1:

  • text: “Great. We have developed more than 100+ web applications till date!”

utter_ask_requirement:

  • text: “Can you share some brief description of your requirements?”

utter_ask_mockup:

  • text: “Alright! \n\nDo you have any of the following ready?” buttons:
    • title: “Wireframes” payload: “Wireframes”
    • title: “Designs” payload: “Designs”
    • title: “RFP or any Document” payload: “RFP or any Document”
    • title: “None” payload: “None”

utter_urlAvailable:

  • text: “Is there any URL that you would like to share for our reference?” buttons:
    • title: “Yes” payload: “yes”
    • title: “No” payload: “no”

utter_ask_url:

  • text: “Could you please share the URL with us?”

utter_ask_timeline:

  • text: “When do you plan to enter development with this project?” buttons:
    • title: “Immediately” payload: “Immediately”
    • title: “within a month” payload: “within a month”
    • title: “within the next 3 months” payload: “within the next 3 months”
    • title: “after 3 months” payload: “after 3 months”

utter_ask_budget:

  • text: “Great!\n\nWhat is your earmarked budget for this project?” buttons:
    • title: “Below $5000” payload: “Below $5000”
    • title: “$5000 - $15000” payload: “$5000 - $15000”
    • title: “$15000 - $25000” payload: “$15000 - $25000”
    • title: “$25000 and above” payload: “$25000 and above”

utter_ask_name:

  • text: “Great. May I know your name please?”

utter_ask_email:

  • text: “Can you please share your email ID? Trust us, we will never spam!”

utter_ask_phone:

  • text: “Can I have your phone number”

utter_lead_q2:

  • text: “Thanks for answering all our questions and being this patient. We appreciate it!”

utter_lead_q3:

  • text: “Here is your data: \n - requirement: {requirement}\n - mockup: {mockup}\n - url: {url}\n - timeline: {timeline}\n - budget: {budget}\n - name: {name}\n - email: {email}\n - phone: {phone}”

utter_lead_q4:

  • text: “I will have our Business Experts get in touch with you soon, to make your project a reality!”

utter_lead_q5:

  • text: “In the meanwhile for anything, you can contact us at sales@cedextech.com or +91 888 999 9999”

utter_goodbye:

  • text: “Thank you. Have a nice day.”

utter_bot_challenge:

  • text: “Sorry can’t understand it.”

session_config: session_expiration_time: 60 carry_over_slots_to_new_session: true

actions:

  • utter_greet
  • utter_menu
  • utter_urlAvailable
  • utter_lead_q1
  • utter_lead_q2
  • utter_lead_q3
  • utter_lead_q4
  • utter_lead_q5
  • utter_goodbye
  • utter_bot_challenge

FormAction: lead_form_p1: requirement: - type: from_entity - entity: requirement mockup: - type: from_entity - entity: mockup

lead_form_p2: url: - type: from_entity - entity: url

lead_form_p3: timeline: - type: from_entity - entity: timeline budget: - type: from_entity - entity: budget name: - type: from_entity - entity: name email: - type: from_entity - entity: email phone: - type: from_entity - entity: phone

action file:

This files contains your custom actions which can be used to run

custom Python code.

See this guide on how to implement these action:

Custom Actions

This is a simple example for a custom action which utters “Hello World!”

from typing import Any, Text, Dict, List,Union,Optional

from rasa_sdk import Action, Tracker

from rasa_sdk.executor import CollectingDispatcher

from rasa_sdk.forms import FormAction

class LeadFormFirstPart(FormAction):

"""Example of a custom form action"""

def name(self) -> Text:

    """Unique identifier of the form"""

    return "lead_form_p1"

@staticmethod

def required_slots(tracker: Tracker) -> List[Text]:

    """A list of required slots that the form has to fill"""

    return ["requirement", "mockup"]

def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:

    """A dictionary to map required slots to

        - an extracted entity

        - intent: value pairs

        - a whole message

        or a list of them, where a first match will be picked"""

    return {

        "requirement": [

            self.from_text(),

        ],

        "mockup": [

            self.from_text(),

        ],

    }

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_urlAvailable", tracker)

    return []

class LeadFormSecondPart(FormAction):

"""Example of a custom form action"""

def name(self) -> Text:

    """Unique identifier of the form"""

    return "lead_form_p2"

@staticmethod

def required_slots(tracker: Tracker) -> List[Text]:

    """A list of required slots that the form has to fill"""

    return ["url"]

def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:

    """A dictionary to map required slots to

        - an extracted entity

        - intent: value pairs

        - a whole message

        or a list of them, where a first match will be picked"""

    return {

        "url": [

            self.from_text(),

        ],

    }

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"""

        

    return []

class LeadFormThirdPart(FormAction):

"""Example of a custom form action"""

def name(self) -> Text:

    """Unique identifier of the form"""

    return "lead_form_p3"

@staticmethod

def required_slots(tracker: Tracker) -> List[Text]:

    """A list of required slots that the form has to fill"""

    return ["timeline", "budget", "name", "email", "phone"]

def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:

    """A dictionary to map required slots to

        - an extracted entity

        - intent: value pairs

        - a whole message

        or a list of them, where a first match will be picked"""

    return {

        "timeline": [

            self.from_text(),

        ],

        "budget": [

            self.from_text(),

        ],

        "name": [

            self.from_text(),

        ],

        "email": [

            self.from_text(),

        ],

        "phone": [

            self.from_text(),

        ],

    }

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_lead_q2", tracker)

    return []

Rasa Version : 2.5.1 Minimum Compatible Version: 2.2.0a1 Rasa SDK Version : 2.5.0 Rasa X Version : 0.39.1 Python Version : 3.6.10

@darpant-289

In domain.yml, the section name is forms: and not FormAction: Please change this, train it again and let me know.

okay sure

NLU model training completed. Your Rasa model is trained and saved at ‘D:\Rasa\models\nlu-20210505-113734.tar.gz’. Core training was skipped because no valid domain file was found. Only an NLU-model was created. Please specify a valid domain using the ‘–domain’ argument or check if the provided domain file exists.

Looks like your domain file is not picked up. Can you share me a screenshot of your project directory and upload your domain file.

domain.yml (4.5 KB)

Domain file looks good. But your domain file is residing inside test dir. In that case, you need to point the path via --domain when you run rasa train.

Domain file is not in test dir. It is in main dir.

@darpant-289

Yep. I misread it. Can you try this domain file ?domain.yml (4.5 KB)

okay thanks let me try

same issue: NLU model training completed. Your Rasa model is trained and saved at ‘D:\Rasa\models\nlu-20210505-122934.tar.gz’. Core training was skipped because no valid domain file was found. Only an NLU-model was created. Please specify a valid domain using the ‘–domain’ argument or check if the provided domain file exists.

@darpant-289 May i know what is the command your are using to train ?

rasa train