hello guys, to consolidate my knowledge in rasa i’m developing a bot for a pizzeria. To collect order information, I am using the form. Since a pizza can have up to 4 different flavors, I created a list type slot to store them. When the user types the desired flavors, the form stores the list in the “tops” slot, but on the next iteration of the form the list elements just disappear, does anyone know what might be going on?
here is the domain:
forms:
order_form:
required_slots:
tops:
- entity: tops
type: from_entity
size:
- entity: size
type: from_entity
border:
- type: from_text
entities:
- border
- drink
- size
- tops
slots:
salutation:
type: text
influence_conversation: true
tops:
type: list
influence_conversation: true
requested_slot:
type: any
influence_conversation: false
here is the “tops” validation:
def validate_tops(
self,
slot_value: Any,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: DomainDict,
) -> Dict[Text, Any]:
"""Validate `pizza_type` value."""
if len(slot_value) == 0:
return {"tops": None}
if len(slot_value) > 4:
dispatcher.utter_message(text=f"Desculpe, só servimos pizzas de até 4 sabores")
return {"tops": None}
for top in slot_value:
if top.lower() not in ALLOWED_PIZZA_TOPS:
dispatcher.utter_message(text=f"Desculpe, não temos a opção { top }, você pode escolher entre {'/'.join(ALLOWED_PIZZA_TOPS)}.")
return {"tops": None}
dispatcher.utter_message(text=f"Ok! uma pizza de {'/'.join(slot_value)}.")
return {"tops": slot_value}```