Hi,
I have implemented the categorical slot in my story. My categorical slot is getting set from the custom actions that I have defined in actions.py file. The story which I have defined should only follow when my booking status is cancelled. But even if my booking status is some other value other than cancelled, the story is getting picked.
Kindly help me with this issue.
My stories.yml file
- story: Cancelled status story
steps:
- intent: modify_booking_status_noshow_with_invoice_no
entities:
- invoice_no: B8H07344
- slot_was_set:
- invoice_no: B8H07344
- action: action_extract_booking_status
- slot_was_set:
- booking_status: cancelled
- action: utter_noshow_process_details_cancelled
Here is my actions.py file
class ActionBookingStatus(Action):
def name(self) -> Text:
return "action_extract_booking_status"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
bookingInvoice = tracker.get_slot("invoice_no")
if bookingInvoice == 'ZUJR0078':
bookingIdStatus = 'confirmed'
dispatcher.utter_template("utter_booking_status", tracker, bookingStatus=bookingIdStatus)
elif bookingInvoice == 'IAI15508':
bookingIdStatus = 'check in'
dispatcher.utter_template("utter_booking_status", tracker, bookingStatus=bookingIdStatus)
elif bookingInvoice == 'HFHG6514':
bookingIdStatus = 'check out'
dispatcher.utter_template("utter_booking_status", tracker, bookingStatus=bookingIdStatus)
elif bookingInvoice == 'B8H07344':
bookingIdStatus = 'cancelled'
dispatcher.utter_template("utter_booking_status", tracker, bookingStatus=bookingIdStatus)
elif bookingInvoice == 'ER637550':
bookingIdStatus = 'no show'
dispatcher.utter_template("utter_booking_status", tracker, bookingStatus=bookingIdStatus)
return [SlotSet("booking_status", bookingIdStatus)]
My domain.yml file
intents:
- modify_booking_status_noshow_with_invoice_no:
use_entities: true
entities:
- invoice_no
slots:
invoice_no:
type: rasa.shared.core.slots.TextSlot
initial_value: null
auto_fill: true
influence_conversation: true
booking_status:
type: rasa.shared.core.slots.CategoricalSlot
initial_value: null
auto_fill: true
influence_conversation: true
values:
- confirmed
- check in
- check out
- cancelled
- no show
actions:
- action_extract_booking_status