Hey guys, I’m still trying to implement a form action and basically it’s working out good, but I’m having a problem with the extraction of a slot of type float.
I have the the following slot:
semester:
type: float
max_value: 100.0
min_value: 0.0
I want my form to ask the user in which semester he is in right now and the user to answer through an intent called give_number that has the entity number.
In the request_next_slot function of my FormAction, I have logic that should trigger something if the given number is greater than 12:
def request_next_slot(
self,
dispatcher: "CollectingDispatcher",
tracker: "Tracker",
domain: Dict[Text, Any],
) -> Optional[List[EventType]]:
for slot in self.required_slots(tracker):
if self._should_request_slot(tracker, slot):
[....]
if tracker.get_slot('semester') > 12:
dispatcher.utter_message(template="utter_deny_semester")
dispatcher.utter_message(template="utter_can_i_help")
return self.deactivate()
Unfortunetly whenever my bot comes to actually starting the form, my action server throws this error:
File "/home/sugarshock/bildungsbot-ai/actions.py", line 95, in request_next_slot
if tracker.get_slot('semester') > 12:
TypeError: '>' not supported between instances of 'NoneType' and 'int'
Now my question is: what is the right way to make a comaprisson with my float slot value in form logics?