Free text type for slot

hi @r4sn4! did you find a good solution for your issue of free-text? i am facing a similar issue and the core expects my free text to belong in an intent.

Please share your experience.Thanks in advance! :slight_smile:

Hi guys, is there a solution to this problem ? i’m facing a similar issue.

Thanks for all :slight_smile:


EDIT : found my solution → How to input free text with custom actions & slots

hi @akelad …what if I have to ask the following questions , all of them are free text 1)what is the name of the story 2)what is the name of the project 3)what is the name of the lead

I want to capture these free text and send to one single action where API call is performed on these 3. How to capture them.

anyone knows if this was implemented and released?

Hi Is this issue fixed by new feature that allow free or random text to be capture in slot without specifying intent. I tried to implement with some intent having specific prefix but it again requires entire example w/ prefix. Why can’t it consider some prefix or suffix word as identifier or indicator for specific intent w/ some random or free text?

e.g.
entities -generic_query

and

intent generic_query_inform: examples | query=[ xxxxxx ] ( generic_query ) ?

so when bot utter (utter_ask_generic_query) either through form slot then with above example when i enter below text with some prefix (i.e. here query=) ideally classify it to <generic_query_inform> intent but it does not.

query=who is the CEO of Apple?

any idea, whether this feature or bug fix still in progress or there is any workaround like some regEx w/ or w/o prefix/suffix can help to classify free or random text to some intent and capture that into slot.

This can be achieved in forms by using code snippet for example:

forms:
  form_name:
     required_slots:
       name:
          type: from_text

if you still face issue let me know

HI All, I need to read a path from user input. Something like /tmp. So my flow is breaking in the stories.yml and actions.py. domain.yml path: type: rasa.shared.core.slots.TextSlot initial_value: null auto_fill: true influence_conversation: true

stories.yml

  • story: create directory steps:
    • intent: request_create_dir
    • action: utter_ask_host
    • intent: my_host entities:
      • host: “etlld0013”
    • slot_was_set:
      • host: “etlld0013”
    • action: utter_ask_dir
    • intent: my_dir entities:
      • dir: “test”
    • slot_was_set:
      • dir: “test”
    • action: utter_ask_path
    • intent: my_path entities:
      • path: “/tmp”
    • slot_was_set:
      • path: “/tmp”

actions.py class ActionCreateSubmit(Action): def name(self) → Text: return “action_create”

def run(
    self,
    dispatcher,
    tracker: Tracker,
    domain: Dict[Text, Any],
) -> List[Dict[Text, Any]]:
    dispatcher.utter_message(template="utter_create_thanks",
                             Host=tracker.get_slot("host"),
                             Directory=tracker.get_slot("dir"),
                             Path=tracker.get_slot("path"))

Hi, don’t validate your slot value in stories instead do it inside custom actions, also why you want to influence conversation?

Hi Dishant…Is it necessary to mentioned intent in case of Slot mapping from_text ?

just if you want to get that intent values

Hello, @Horizon733 I am trying to use forms to fill slots with responses to three questions. I am using Rasa 3 forms and from_text mapping but when the first slot has filled the others are also filled with the same value causing the form to be deactivated. I want after the first slot is filled, the bot asks the second question so on until three questions. Do you know what I am doing wrong? Thanks in advance for your help.

Hi Jonathan, It is possible, there is a way. You can use validate_<slot_name> inside class validate_form_name. On top of that, you can check inside validate_<slot_name> if the pre-filled value is correct or not.

def validate_slot_name(...):
   if slot_value in [something]:
     return {"slot_name": slot_value}
  else:
    return {"requested_slot": "slot_name"}

Like above code

Thanks, @Horizon733 for the response. I also found another solution on Rasa github using conditions. I am using it and works as I expected “requested_slot” makes the magic.

slots:
  topic:
    type: text
    influence_conversation: true
    mappings:
      - type: from_text
        conditions:
          - active_loop: simple_trainning_form
            requested_slot: topic

  meet_with:
    type: text
    influence_conversation: true
    mappings:
      - type: from_text
        conditions:
          - active_loop: simple_trainning_form
            requested_slot: meet_with

Hi, yes it is good like this, but I don’t consider this as solution for every form. Since validation will be needed even after adding conditions

I agree with you @Horizon733 other applications will requiere a validation. This solution worked perfectly in our case because our application requires to save the complete sentence (free-text without entity extraction) written by the user we do not need extra validation.

1 Like

Hi Can I see your stories.yml and rules.yml

I am facing exactly what you are doing