Cannot find required key 'mappings'. Path: '/slots/ticker'

I’m trying to create bot using rasanlu butb getting following error:Cannot find required key 'mappings'. Path: '/slots/ticker'

OS: ubuntu

Rasa Version: 3.0.6

Python Version: 3.8.12

domain.yml

version: "3.0"

intents:
  - greet
  - goodbye
  - affirm
  - deny
  - mood_great
  - mood_unhappy
  - bot_challenge
  -  price:
      use_entities:
        - ticker

actions:
  - action_current_price


entities:
  - ticker

slots:
  ticker:
    type: undefined

responses:
  utter_greet:
  - text: "Hey! How are you?"

  utter_cheer_up:
  - text: "Here is something to cheer you up:"
    image: "https://i.imgur.com/nGF1K8f.jpg"

  utter_did_that_help:
  - text: "Did that help you?"

  action_current_price:
  - text: Ok, getting price of [ticker] ...

  utter_happy:
  - text: "Great, carry on!"

  utter_goodbye:
  - text: "Bye"

  utter_iamabot:
  - text: "I am a bot, powered by Rasa."

session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true

can anyone help?

Hello and welcome to the forum!

@mahendra210 try to follow the new syntax for Rasa 3.x Ref: Domain see the concept of mapping.

1 Like

Thank you. I was using wrong syntax.

@mahendra210 it happen no worries :slight_smile:

Using correct syntax than to the same error occurs. What to do now?

@nilesh_08 … can you show your slot part of the domain file.

Examples:

entities:
  - attribute

slots:
  attribute:
    type: text
    mappings:
    - type: from_entity
      entity: attribute
entities:
  - email
  - number
slots:
  name:
    - type: text
      influence_conversation: false
  email:
    - type: text
      influence_conversation: false
  phone_number:
    - type: text
      influence_conversation: false
  message:
    - type: text
      influence_conversation: false
  confirm_details:
    - type: any
      influence_conversation: false

If youre using rasa3 then there is bit change in the way of declaring and each slot each slot should be accompanied by a key called “mappings”

For your reference: Slots in Rasa Open Source 3.0 | The Rasa Blog | Rasa

slots:
  concerts:
    type: list
    influence_conversation: false
    mappings:
    - type: custom
  venues:
    type: list
    influence_conversation: false
    mappings:
    - type: custom
  likes_music:
    type: bool
    influence_conversation: true
    mappings:
    - type: custom

Thank you, but it didn’t work for me. Still gives same error. YamlValidationException: Failed to validate

YamlValidationException: Failed to validate … implies you’re giving a wrong syntax. Can you post updated full or necessary part of the domain If the work, you carry is your personal and have no obligation.

version: "3.1"
intents:
  - greet
  - goodbye
  - affirm
  - deny
  - faq
  - chitchat
  - contact_us
  - outofscope
entities:
  - email
  - number
slots:
  name:
    type: text
    influence_conversation: false
    mappings:
      - type: custom
  email:
    type: text
    influence_conversation: false
    mappings:
      - type: custom
  phone_number:
    type: text
    influence_conversation: false
    mappings:
      - type: custom
  message:
    type: text
    influence_conversation: false
    mappings:
      - type: custom
  confirm_details:
    type: text
    influence_conversation: false
    mappings:
      - type: custom

responses:
  utter_greet:
    - text: Hey! How are you?
  utter_chitchat/mood_unhappy:
    - text: "Here is something to cheer you up:"
      image: https://i.imgur.com/nGF1K8f.jpg
  utter_chitchat/mood_great:
    - text: Great, carry on!
  utter_chitchat/bot_challenge:
    - text: I am a bot, powered by Lemon Technology.
  utter_faq/shipping_duration:
    - text: Standard time usually takes about 5-7 business days.
  utter_faq/payment_modes:
    - text: |-
        Payment modes we are supporting:
         COD
        Debit/Credit cards
        EMI
        Wallets.
  utter_faq/track_product:
    - text: You can track your product from your accounts -> Orders.
  utter_return_policy:
    - text: If you want to return any product you can return.
  utter_outofscope:
    - text: Sorry, I wasn't able to understand. Could you please rephrase it?
  utter_ask_name:
    - text: Could you please tell me your full name?
  utter_ask_email:
    - text: Could you please tell me your email address?
  utter_ask_phone_number:
    - text: Can you please provide me your contact number?
  utter_ask_confirm_details:
    - buttons:
        - title: Yes
          payload: Yes
        - title: No
          payload: No
    - text: |-
        These are the details you gave me. Please confirm them below:
         Name: {name}
         Email: {email}
         Contact: {phone_number}
         Message: {message}
  utter_mail_success:
    - text: I have mailed all details to our team. You will be reverted back within 48
        hours.
  utter_mail_canceled:
    - text: I have canceled the mail. Anything else you want help with?
  utter_goodbye:
    - text: Bye
actions:
  - validate_contact_us_form
  - action_submit_contact_us_form
forms:
  contact_us_form:
    required_slots:
      name:
        - type: from_text
      email:
        - type: from_entity
          entity: email
      phone_number:
        - type: from_entity
          entity: number
      message:
        - type: form_text
      confirm_details:
        - intent: affirm
          value: yes
          type: from_intent
        - intent: deny
          value: no
          type: from_intent
session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true

This is my full domain file.

Looks like there few things needs to be sorted out in this domain :

  1. Slot needs to declared properly if slot values are filled using entity then in mapping you can mention like this :
entities:
  - attribute

slots:
  attribute:
    type: text
    mappings:
    - type: from_entity
      entity: attribute

and when you’re having buttons, the key “text” should be provided correctly.

  utter_ask_confirm_details:
    - buttons:
      - payload: Yes
        title: Yes
      - payload: No
        title: No
      text : "These are the details you gave me. Please confirm them below:
         Name: {name}
         Email: {email}
         Contact: {phone_number}
         Message: {message}"

Rasa 3 forms is more simplified. Most of the declaration now done in slot part not in forms part.

entities:
- cuisine
- number
slots:
  cuisine:
    type: text
    mappings:
    - type: from_entity
      entity: cuisine
  num_people:
    type: any
    mappings:
    - type: from_entity
      entity: number
forms:
  restaurant_form:
    ignored_intents: 
    - chitchat
    required_slots:
        - cuisine
        - num_people

please look the above example try to modify your form and slot. (I have tried correct your domain but without knowing your design of the bot its hard to correct but attaching here …it may be helpful…)

domain.yml (2.7 KB)

See Rasa 3 docs specially for slots and forms if you're building bot.
Happy learning