I have a story in which after asking some questions, feedback is being provided to the user. This I have done by using logic in custom action with Followup event.
My goal is after proving feedback to users, I want to suggest some opinions to the user. This I want to implement using the checkpoint.
Here is my custom action logic
class AssessorFeedback(Action):
def name(self) -> Text:
return "action_assessor_feedback"
def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
is_asking = tracker.get_slot('state') == 'questions'
if is_asking:
dispatcher.utter_message(text="Thank you for answering my questions 😁")
if self.__user_needs_evaluation(tracker):
score_resolution = ["This is some issue with your mind"]
else:
score_resolution = ["There is defintly something wrong with your mind."]
print("this is the score resolution")
print(score_resolution[0])
dispatcher.utter_message(text=str(score_resolution[0]))
return [SlotSet('state', 'feedback')]
else:
dispatcher.utter_message(text="It is ok. I hope to talk to you some other time!")
return [SlotSet('state', 'feedback')]
The above feedback was executed using the following custom action :
class ActionAskQuestion(Action):
def name(self) -> Text:
return "action_ask_question"
def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
current_question = tracker.get_slot('question_id')
if current_question == len(QUESTIONS):
return [FollowupAction("action_assessor_feedback")]
My original story -
stories:
- story: new happy path
steps:
- intent: affirm
- slot_was_set:
- state: intro
- action: action_start_questions
- action: action_ask_question
- intent: answer_question
- slot_was_set:
- state: questions
- action: action_update_score
- action: action_give_feedback
- action: action_ask_question
- slot_was_set:
- frequency: null
- slot_was_set:
- state: feedback
- checkpoint: ask_feedback
- story: happy path 2 genrated using RASA x
steps:
- intent: affirm
- slot_was_set:
- state: intro
- action: action_start_questions
- action: action_ask_question
- slot_was_set:
- question_id: 1
- intent: answer_question
entities:
- frequency: low-medium
- slot_was_set:
- frequency: low-medium
- action: action_update_score
- slot_was_set:
- score_questions: 1
- action: action_give_feedback
- action: action_ask_question
- slot_was_set:
- question_id: 2
- intent: answer_question
entities:
- frequency: medium
- slot_was_set:
- frequency: medium
- action: action_update_score
- slot_was_set:
- score_questions: 3
- action: action_give_feedback
- action: action_ask_question
- slot_was_set:
- frequency: null
- slot_was_set:
- state: feedback
- checkpoint: ask_feedback
###############################################################################3
- story: user said yes to bunty
steps:
- checkpoint: ask_feedback
- action: utter_bunty_request
- intent: affirm
- action: action_bunty_link
- action: action_end_conversation
#################################################################
Now the issue the checkpoint never executed, it conversation only works till –
- action: action_ask_question
- slot_was_set:
- frequency: null
- slot_was_set:
- state: feedback
In this part I got the bot feedback but the checkpoint conversation never works. Bot predicts action_default_fallback.
I also try by creating a story without checkpoints like this—
- story: happy path 2 when user accept bunty's conversation
steps:
- intent: affirm
- slot_was_set:
- state: intro
- action: action_start_questions
- action: action_ask_question
- slot_was_set:
- question_id: 1
- intent: answer_question
entities:
- frequency: low-medium
- slot_was_set:
- frequency: low-medium
- action: action_update_score
- slot_was_set:
- score_questions: 1
- action: action_give_feedback
- action: action_ask_question
- slot_was_set:
- question_id: 2
- intent: answer_question
entities:
- frequency: medium
- slot_was_set:
- frequency: medium
- action: action_update_score
- slot_was_set:
- score_questions: 3
- action: action_give_feedback
- action: action_ask_question
- slot_was_set:
- frequency: null
- slot_was_set:
- state: feedback
- action: utter_bunty_request
- intent: affirm
- action: action_bunty_link
- action: action_end_conversation
But the same issue, the story stucks after the bot’s feedback. Any help is appreciated. @souvikg10