Hi Everyone,
I’m loving Rasa. Most things have been going well. However, despite two days of trying and searching, I’ve had no luck with this seemingly common issue. The goal is to simply deactivate a form on command. A user activates form by typing “create use case”. But if in the middle the user decides to exit (cancel), I can’t seem to get it to work. I have an intent - stop_form. I’m using stop_form to trigger an utterance that ask if they are sure. If the response is affirmed, then the form should be deactivated. For clarity, I’ve listed all relevant parts of this process from the nlu, domain and stories files. Any help is appreciated. Can’t trigger the intent. I’m using Rasa 2.0
#domain.yml
intents:
- stop_form:
use_entities: []
slots:
usecase_id:
type: text
influence_conversation: false
user_id:
type: text
influence_conversation: false
user_name:
type: text
influence_conversation: false
responses:
utter_ask_continue:
- text: Do you want to continue? Yes or No...
forms:
use_case_form:
use_case_name:
- type: from_text
use_case_description:
- type: from_text
use_case_note:
- type: from_text
#nlu.yml
- intent: stop_form
examples: |
- please stop this form
- stop form
- I want to stop form
- I don't want to continue this form
- please cancel form
- intent: affirm
examples: |
- yes
- y
- sure
- absolutely
- definitely
- cool
- indeed
- of course
- that sounds good
- correct
- ye
- uh yes
- let's do it
- yeah
- uh yes
- um yes
- yes knocking
- that's correct
- yes yes
- right
- yea
- yes right
- yes and i dont care
- right on
- i love that
- intent: deny
examples: |
- no
- naaaa
- never
- I don't think so
- don't like that
- no way
- not really
- no new selection
- no thanks
- no thank you
- uh no
- breath no
- do you have something else
- no this does not work for me
- heck no!
- hell no
#stories.yml
- story: stop use case form + continue #happy path
steps:
- intent: create_use_case
- action: use_case_form
- active_loop: use_case_form
- intent: stop_form
- action: utter_ask_continue
- intent: affirm
- action: use_case_form
- active_loop: null
- action: action_submit_use_case
- action: utter_submit_use_case
- story: stop use case form + stop #unhappy path - stop form
steps:
- intent: create_use_case
- action: use_case_form
- active_loop: use_case_form
- intent: stop_progress
- action: utter_ask_continue
- intent: deny
- action: action_deactivate_loop
- active_loop: null
@eaofcc Hey! Did you mentioned intent: create_use_case in nlu.yml and action_submit_use_case (which custom action you have created in actions.py) did you mentioned in domain.yml? under actions such as
actions:
- action_submit_use_case
If you are using please see code snippet from rasa doc:
stories:
- story: User interrupts the form and doesn't want to continue
steps:
- intent: request_restaurant
- action: restaurant_form
- active_loop: restaurant_form
- intent: stop
- action: utter_ask_continue
- intent: stop
- action: action_deactivate_loop
- active_loop: null
Hey Thanks for the response. Ok to answer your question, yes and yes. The create_use_case is in the nlu and effectively activates the form and the action_submit_use_case is in the actions section of the domain.yml file. My custom actions for the form are below:
Funny thing is that I modeled my story after the example you provided. , where “stop” was replaced by “stop_form”. I’m not too particular, just want to find an effective way to do it. Open to all suggestions. Thanks again
Ok thanks. FYI, the interactive isn’t helping because I have form slots. It asks for input and if I type in anything it give an nlu_fallback. And then it attempts to see if i want to map the slot to an intent. This is super confusing because the form actually works when I’m using rasa X or rasa-chat.
Thanks for sharing! I’m having similar issues but for a slightly different use case. There appears to be a bug for deactivating forms for rasa_sdk. Hopefully this thread helps: Rasa 2.0 - How to deactivate a form during validation?
Thanks! I’ve actually seen this post. I’ll check again to see if anything can get me unstuck. Deactivating a form in Rasa is proving to be far more complicated than I thought.
I’m still looking for a solution. Wish there was a standard way to deactivate a form, since this is a pretty normal requirement. It seems that the intent is fired if not slot has been filled. So after the form is active but before the first slot is filled, the stop_form intent works if the user types “stop form”. This then triggers everything else, and if the use types no, the form is deactivated. However, if one field is completed and then the user types “stop form” the intent doesn’t work.
@eaofcc Then I will suggest upgrade to 2.6.2 and 2.6.0 respectively or latest till 2.7.1 and 2.7.0 and try your code then. I will seen your code in evening.
I did try upgrading to 2.7 (Rasa and rasa_sdk). But the issue is that when I do, the rasa-webchat widget stops working, due to socketio incompatibility.