@laboratory I just tried replicating your issue and I didn’t get any failed test stories. This is what I did:
- use
rasa init
to create bot template - add 2 new intents (
check_lockdown
;specify_location
) and two entities (location
,postcode
) - add a similar custom action to what yours does (
action_check_lockdown
):
class ActionCheckLockdown(Action):
def name(self) -> Text:
return "action_check_lockdown"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
entity = next(tracker.get_latest_entity_values("location"), None)
if entity:
dispatcher.utter_message(text="Yes, I can check this area for you, please specify exact address.")
else:
dispatcher.utter_message(text="Please specify exact address.")
return []
- add a story in
stories.yml
; nothing added torules.yml
- story: handle lockdown check
steps:
- intent: check_lockdown
- action: action_check_lockdown
- intent: specify_location
- action: action_check_lockdown
- write two additional test stories
- story: lockdown + location found
steps:
- user: |
I would like to check lockdown rules in [Islington]{"entity": "location"}.
intent: check_lockdown
- action: action_check_lockdown
- user: |
This is my postcode: [SW1W 9AX]{"entity": "postcode"}.
intent: specify_location
- action: action_check_lockdown
- story: lockdown + location not found
steps:
- user: |
I would like to check lockdown rules in my area.
intent: check_lockdown
- action: action_check_lockdown
- user: |
This is my postcode: [SW1W 9AX]{"entity": "postcode"}.
intent: specify_location
- action: action_check_lockdown
I will aim to follow-up to your question on Fallbacks in the next few hours, that’s an entirely different topic.
Please also note we aim to provide a response usually within a 3-day time window, so I would ask for a bit of patience.