Hello,
as i am working on one some survey bot in that i need to ask reason for the low rated answer given by user.
attaching my code here
where if the rating of 1st_qn is below or equal to 3, I need to ask 1st_reason slot otherwise it need to ask 2nd_qn like wise all three questions
Hi @stephens
I have been trying to handle the slots through the required_slots method, but it’s not working correctly. I am not able to loop the slot values to check the rating entered by the user for the next slot value but it is working only one time and in the remaining cases it’s not asking for the subsequent slot.
domain file
forms:
survey_form:
required_slots:
- 1st_qn
action.py file
async def required_slots(
self,
domain_slots: List[Text],
dispatcher: "CollectingDispatcher",
tracker: "Tracker",
domain: "DomainDict",
) -> List[Text]:
"""A list of required slots that the form has to fill"""
l = ['3', '2', '1']
if tracker.get_slot('1st_qn') in l:
print(tracker.get_slot('1st_qn'))
return ["1st_qn", "1st_reason","2nd_qn","2nd_reason", "3rd_qn", "3rd_reason"]
else:
return ["1st_qn", "2nd_qn", "3rd_qn"]