2

I have created a custom action using slot and while running the bot, slot value is not getting filled. My action file is as below:

from typing import Any, Text, Dict, List

from rasa_sdk import Action from rasa_sdk.events import SlotSet

class ActionCheckRestaurants(Action): def name(self) -> Text: return "action_check_restaurants"

def run(self, dispatcher, tracker, domain):

  entity_name = tracker.get_slot('entity_name')
  response= """the name is {}""".format(entity_name)
  dispatcher.utter_message(response)
  return [SlotSet("entity_name", entity_name)]

and My domain file is ;

intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
- ask_landing
- ask_raw
- ask_entity
- inform
entities:
- entity_name
slots:
  entity_name:
    type: categorical
    values: []
responses:
  utter_greet:
  - text: Hey! How are you?
  utter_cheer_up:
  - text: 'Here is something to cheer you up:'
    image: httpd://i.imgur.com/nGF1K8f.jpg
  utter_did_that_help:
  - text: Did that help you?
  utter_happy:
  - text: Great, carry on!
  utter_goodbye:
  - text: Bye
  utter_data:
  - text: what data you are looking for?
  utter_entity_name:
  - text: which entity you need data
actions:
- utter_greet
- utter_cheer_up
- utter_did_that_help
- utter_happy
- utter_goodbye
- utter_data
- utter_raw
- utter_landing
- action_check_restaurants
- fetch_profile
- utter_entity_name

not sure what's the issue.

ESCoder
  • 15,431
  • 2
  • 19
  • 42
vikas m
  • 23
  • 4

1 Answers1

1

in your domain I can see a categorical slot without defined values (slots: entity_name: type: categorical values: [] ).
Use text instead (or define the possible values).

Beppe C
  • 11,256
  • 2
  • 19
  • 41