Reputation: 53
Despite two days of trying and searching, I've had no luck with this. 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 affirm, 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. Note: I'm using Rasa 2.0. Thx!
**#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
Upvotes: 3
Views: 1238
Reputation: 21
In your validate_slotName
do this -> return {'requested_slot':None}
.
Upvotes: 1