Hi , currently i making a retail bot to get user feedback. I need my bot to not utterence response when user say deny (e.g say No) just like the stories: feedback stop flow below . But it does not happen to my bot
example :
Your input → feedback
Bot: Would you like to provide us on feedback on our service with misty, Please awnswer yes or no to move on.
When customer say “NO” or Deny :
Your input → no
Bot: Hey, Sorry that it does not meet your expectation we will do our best to improve the experience in future. <<-- This utter should be skipped if user say no btw this was the response based on conditional response variation ref : How to adjust chatbot responses based on sentiment - #4 by JulianGerhard
This is the validation Form in actions.py
class ValidateFeedbackForm(FormValidationAction):
def name(self) -> Text:
return "validate_feedback_form"
async def validate_confirm_feedback(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Dict[Text, Any]:
if value:
return {"confirm_feedback": True}
else:
return {"feedback": "None", "confirm_feedback": False }
domain.yml
feedback_form:
confirm_feedback:
- type: from_intent
intent: affirm
value: True
- type: from_intent
intent: deny
value: False
- type: from_intent
intent: inform
value: True
feedback:
- type: from_text
intent: info_feedback
stories.yml
-
story: Activate feedback form happy path steps:
- intent: customer_feedback
- action: feedback_form
- active_loop: feedback_form
-
story: feedback stop steps:
- intent: customer_feedback
- action: feedback_form
- active_loop: feedback_form
- intent: deny
- action: action_deactivate_loop
- active_loop: null
- action: action_restart
-
story: feedback continue steps:
- intent: customer_feedback
- action: feedback_form
- active_loop: feedback_form
- intent: affirm
- action: feedback_form
- action: utter_based_on_sentiment
Hope someone can provide me a little help here thanks