Rasa 2.x slots and form

Hello,

I would like to create 3 slots in one form. I have to retrieve these 3 slot values at the end and pass on to api. Now, I would request anyone to help me in creating 3 slots under a form. What should i put in rules.yml?

Thank you.

Hello,

Have you read the docs?


Define the form:

forms:
  restaurant_form:
    required_slots:
        name:
          - type: from_text
        cuisine:
          - type: from_entity
            entity: cuisine
        num_people:
          - type: from_entity
            entity: number

Activate the form:

rules:
- rule: Activate form
  steps:
  - intent: request_restaurant
  - action: restaurant_form
  - active_loop: restaurant_form

Deactivate the form:

rules:
- rule: Submit form
  condition:
  - active_loop: restaurant_form
  steps:
  - action: restaurant_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - action: utter_submit
  - action: action_send_slots_values_to_api
1 Like

Appreciate quick help. Thanks.

1 Like