Rasa custom action not triggering another story

Recover_pin_code_T9erhAW_stories.yml (1.6 KB)

@souvikg10 souvikg10 can you please help? please class ActionFromWhereDoYouWantToTransferMoneyFrom(Action):

def name(self) -> Text:
    return "action_from_where_do_you_want_to_transfer_money_from"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    user_choice = tracker.get_slot("transfertype")

    return [SlotSet("transfertype", user_choice)]

class ActionEvaluateAmeliaExpFromParent23807cb0(Action):

def name(self) -> Text:
    return "action_evaluate_amelia_exp_from_parent_23807cb0"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

    if (tracker.get_slot("smstype")) == "phone":`Preformatted text`
       return [SlotSet("edge_", "4b9b53c4-39ec-4b0e-a6e5-048f56b212ae"), FollowupAction(name="action_evaluate_amelia_exp_from_parent_23807cb0_result")]
    if (tracker.get_slot("smstype")) == "whatsapp":
       return [SlotSet("edge_", "06cfb640-b3c3-4fb5-93f4-7cfab73e8c06"), FollowupAction(name="action_evaluate_amelia_exp_from_parent_23807cb0_result")]

class ActionEvaluateAmeliaExpFromParent23807cb0Result(Action):

def name(self) -> Text:
    return "action_evaluate_amelia_exp_from_parent_23807cb0_result"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    return

Story file attached.

  1. Story Recover_pin_code_T9erhAW_AmeliaAsks_56c76b90_AmeliaSays_a67ef531 works fine
  2. Story Amelia Asks_AmeliaSays_a67ef531_AmeliaAsks_11070919_AmeliaSays_23807cb0 also gets triggered
    • action: action_do_you_want_on_phone_or_whatsapp takes input however it can not trigger next action. It says no memoized action. It should either trigger story: _AmeliaSays_23807cb0 or _AmeliaSays_534b4f25
  • story: _AmeliaSays_23807cb0 steps:
    • action: action_evaluate_amelia_exp_from_parent_23807cb0_result
    • slot_was_set:
      • edge_: 4b9b53c4-39ec-4b0e-a6e5-048f56b212ae
    • action: utter_you_will_receive_as_regular_message
  • story: _AmeliaSays_534b4f25 steps:
    • action: action_evaluate_amelia_exp_from_parent_23807cb0_result
    • slot_was_set:
      • edge_: 06cfb640-b3c3-4fb5-93f4-7cfab73e8c06
    • action: utter_you_will_receive_on_whatsapp

Follow this steps to triggering custom action : Introduction. Setting up your environment. Installing Rasa Open Source. Deploying Assistants. Introduction. Monitoring and Analyzing Assistants. Analytics. Custom Graph Components. Graph Recipe. Action Server. Introduction. rasa.cli.arguments.data. rasa.cli.arguments.evaluate. Rasa SDK Change Log. Compatibility Matrix. PrepaidGiftBalance Mastercard

You didn’t write about the issue you are facing… :frowning:

I am sorry if I did not make it clear but this is the problem

Point 3

  • action: action_do_you_want_on_phone_or_whatsapp takes input however it can not trigger the next action. It says no memoized action. It should either trigger story: _AmeliaSays_23807cb0 or _AmeliaSays_534b4f25 but it does not happen regularly. Sometime it works and sometime it does not.

I feel like you are missing something here

steps:
  - action: action_evaluate_amelia_exp_from_parent_a67ef531_result
  - slot_was_set:
    - edge_: f7395d28-05bb-4482-a728-5059e3620069
  - action: utter_sure_you_will_receive_your_pincode_via_sms
  - action: utter_do_you_want_on_phone_or_whatsapp
  - intent: recoverpincodeterhaw2
  - action: action_do_you_want_on_phone_or_whatsapp
  - action: action_evaluate_amelia_exp_from_parent_23807cb0

If action_do_you_want_on_phone_or_whatsapp does get triggered, assuming this is a custom action, what exactly does it do? send an utter back to the user? if so, then should you not have intent to take the input from the user after the action? for me, it seems two actions are triggered subsequently,

 - action: action_do_you_want_on_phone_or_whatsapp
 - action: action_evaluate_amelia_exp_from_parent_23807cb0

yet if the first one is assuming an input for the user, you should provide an intent in the story to capture that input before triggering the next action

also how are some of your stories triggered without an intent? are you triggering them in custom actions?

    • action: action_do_you_want_on_phone_or_whatsapp custom action takes input from the user and sets a slot smstype provided by the intent recoverpincodeterhaw2

class ActionDoYouWantOnPhoneOrWhatsapp(Action):

def name(self) -> Text:
    return "action_do_you_want_on_phone_or_whatsapp"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    user_choice = tracker.get_slot("smstype")
    return [SlotSet("smstype", user_choice)]
  1. Then the custom action action_evaluate_amelia_exp_from_parent_23807cb0 is triggered as it is the next step mentioned in the story. This checks for a few conditions

class ActionEvaluateAmeliaExpFromParent23807cb0(Action):

def name(self) -> Text:
    return "action_evaluate_amelia_exp_from_parent_23807cb0"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    if (tracker.get_slot("smstype")) == "phone":
       return [FollowupAction(name="action_evaluate_amelia_exp_from_parent_23807cb0_result")]
    if (tracker.get_slot("smstype")) == "whatsapp":
       return [FollowupAction(name="action_evaluate_amelia_exp_from_parent_23807cb0_result2")]

if the slot smstype is phone as provided by the user then it triggers the next Story (- story: _AmeliaSays_23807cb0) using FollowupAction action_evaluate_amelia_exp_from_parent_23807cb0_result

  • story: _AmeliaSays_23807cb0 steps:
    • action: action_evaluate_amelia_exp_from_parent_23807cb0_result
    • slot_was_set:
      • edge_: 4b9b53c4-39ec-4b0e-a6e5-048f56b212ae
    • action: utter_you_will_receive_as_regular_message

else if the smstype is whatsapp then folowupAction action_evaluate_amelia_exp_from_parent_23807cb0_result2 this is triggered

  • story: _AmeliaSays_534b4f25 steps:
    • action: action_evaluate_amelia_exp_from_parent_23807cb0_result2
    • slot_was_set:
      • edge_: 06cfb640-b3c3-4fb5-93f4-7cfab73e8c06
    • action: utter_you_will_receive_on_whatsapp

class ActionEvaluateAmeliaExpFromParent23807cb0Result(Action):

def name(self) -> Text:
    return "action_evaluate_amelia_exp_from_parent_23807cb0_result"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    return [SlotSet("edge_", "4b9b53c4-39ec-4b0e-a6e5-048f56b212ae")]

class ActionEvaluateAmeliaExpFromParent23807cb0Result2(Action):

def name(self) -> Text:
    return "action_evaluate_amelia_exp_from_parent_23807cb0_result2"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    return [SlotSet("edge_", "06cfb640-b3c3-4fb5-93f4-7cfab73e8c06")]

why we need an intent after one custom action to capture if we are going through the same story? also, how are some of your stories triggered without intent? are you triggering them in custom actions? Yes. I am starting a few of the stories without intent. but using a custom action.

Is it not possible to have a story without intent?

I have attached all of the stories

here is the flow

This is a banking service

Users can select from three options in the main_story either to check their balance, change their pin, or transfer a custom action (action_what_do_you_want_to_do) takes input and that triggers another custom action action_evaluate_amelia_exp_from_parent_76c1a8e0 which checks for an expression evaluation and depending on the expression evaluation result it can either trigger action_evaluate_amelia_exp_from_parent_76c1a8e0_result or —> executes a separate story mentioned in separate file action_evaluate_amelia_exp_from_parent_76c1a8e0_result2 → executes a separate mentioned in a separate file

The same logic I have used everywhere for checking conditions. I have to use an intermediate custom action like action_evaluate_amelia_exp_from_parent_23807cb0 instead of directly using just a slot because I can have a complex expression/condition to check before triggering another story.

The problem is it works for the initial few conditions check but after 2 conditions it does not work.

The above-mentioned story in my Question is part (change) of a bigger story (main story) change_stories.yml (2.8 KB) main_stries.yml (1.2 KB) story_bankbalance.yml (838 Bytes) story_transfer.yml (1000 Bytes)