My bot start a conversation postind an intent.
I would like to have a rule to fill a form but if there is the intent.
In the steps the rule doesn’t take two consecutive intents.
For example :
the bot start the conversation asking if the user wants to register (intent=“register”)
if the user answer “ok” (intent=“affirm”)
a rule should activate the registration_form but only if the intent=“register” + intent=“affirm”
Is there a good way to do it?
After many days of studying I still in the high waters…
Thanks for help !
A little unsure of what you mean. So if the user wants to register (/register), you want the bot to confirm this from the user (“Are you sure you want to register?”) and only if the user says yes (/affirm), you want to trigger the registration form?
@drindrin This is demo code for your use case, do update the code, as per your requirement.
rules:
- rule: Activate registration form
steps:
- intent: schedule_registration_form
- action: registration_form
- active_loop: registration_form
- rule: Submit registration_form
condition:
# Condition that form is active.
- active_loop: registration_form
steps:
- action: registration_form
- active_loop: null
- action: utter_submit
Then, you’ll have a rule or story that prompts your question on if they’d like to fill the registration or not. You’ll need two to cover the affirm + deny scenarios:
- rule: offering registration, affirm
steps:
# you have the user doing something, then offer the registration form:
- action: utter_registration_request
- intent: affirm
- action: registration_form
- active_loop: registratioon_form
- rule: offering registration, deny
steps:
# you have the user doing something, then offer the registration form:
- action: utter_registration_request
- intent: deny
- action: utter_registration_deny
I hope this will solve you query. If this solve please close this thread for others.Good Luck!
Thanks ! It seems that it’s exactly what I need …so my bot have to start the conversation requesting the action “utter_registration_request” ?How am I going to do that ?
Yes Nik I need your help …sorry.
I understood that my bot should start the conversation with “utter_registration_request” but rasa starts expecting an input form user…how am I going to have the bot starting ? (silly question but I can’t figure out )
PS:Should I start another topic?