Form actions

Hi all, intent 1 :

  • 50k actions_1 working for it. intent 2:
  • food 50k actions_2 working on intent 2. I catch the case that the user just inputs only “food” at actions_2. I want to ask the user input number but it’s working on actions_1. Pls let me know how can i do that. I tried with form but it’s not working.

Thanks.

Welcome to the community @mrbil208 :tada:

Could you please share a few more details, such as domain.yml and (if existing) your custom actions?

Hi @Tobias_Wochinger Thanks for your welcome :slight_smile: My actions, domain file, and story file as below.

Story file: stories.yml (1.8 KB).

Actions file :actions.py (25.8 KB).

Domain file: domain.yml (2.2 KB).

Rules file: rules.yml (521 Bytes)

I’m working form on action_save_food_drink as below:

If the user inputs only number(intent: input_value_other ), it will work as below: image

Pls let me know how to handle form in actions. and how to handle the conflict when the user input 2 times (if user input only number => action_save_other, if the user input only category => action_save_food_drink. after that using form to handle number => submit with category and number )

Thanks you so much.

Anyone else can help me in this case?

Thanks.

Which Rasa Open Source version are you using? Did you have a look at the example?

@Tobias_Wochinger

I have looked it and others form in github.

I have done with form. But it’s not the point in this case. My case as below:

if user input only number => action_save_other

if the user input only category or (category and number) => action_save_food_drink. if only category => get category => active form to ask user about number => save number and submit.

There are 2 ways to handle my case :

  • slotset category (entity) from custom action to form. After that form is working and asks the user. As below :

    return [FollowupAction(“user_form”),SlotSet(“category”,category]

  • transfer category using slotset to other custom action. The category still got None. I’m using code as below:

    return [SlotSet(“category”,category] Other custom actions using : tracker.get_slot(“category”) to get value.

Both of cases are not working for me. Pls let me know how to active form in custom action or how can I transfer values of an entity from custom action to another custom action.

Thanks.

@mrbil208 Which Rasa Open Source version are you using?

Have you checked the docs here?

You can always deactive the form by returning [SlotSet("requested_slot": None)]. I’d recommend to follow the recommendations in the docs though.