Tracker.get_slot() returns None value

Hey guys, i am new to Rasa 2.0. I am currently working on a student project which calculates the total price for food that user orders. However, I keep getting TypeError which means tracker.get_slot() returns None value. The code of my custom action is shown below:

I ran the shell with debug mode and it indicates that all the slots are filled:

The error shown on my action server:

The code for rules.yml:

The template that i used for the custom action:

I am a bit confused about the purpose of requested_slot. Does tracker.get_slot() return the value from requested_slot? Because requested_slot is set to null in my rules.yml.

that will be much appreciated if someone can help me out here!

Hi @Elliot . I think the error occurs because for some reason the slot drinks_num returns None for you. Are you filling in this slot with a form? I think what is happening is that in your rules with requested_slot: null you are resetting last requested slot to none. Is there a particular reason why you have this step in your rules?

After your form completes (collects the necessary data), you should submit the form with your custom action. I don’t think I can see that happening in your rules. The rules could look something like the following:

rule: submit_drinks
condition:
- active_loop: drinks_from
steps:
  - actions: drinks_form
  - active_loop: null
  - action_order_confirmed
  - slot_was_set:
    - total: 100
  - action: utter_order_confirmed

Hey Juste, thanks for your message! I have solved the problem. Once again, thank you very much :slight_smile:

No worries @Elliot . Glad you solved it and I am looking forward to seeing what AI assistants you build with Rasa! :slight_smile:

Hey Juste. Thanks for your message. I am currently working on an AI assistant which take orders from users for the restaurant. And this is one of my capstone project :slight_smile: