Hi @SamS I am using custom slot mapping to fill in 3 slots but right after the second slot is set the bot asks for the first slot again, and then second and then first, in an endless loop. It seems the slots are not getting set.
I used the below code.
class ValidateComparisonForm(FormValidationAction):
def name(self) -> Text:
return "validate_comparison_form"
async def required_slots(
self,
slots_mapped_in_domain: List[Text],
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict,
) -> Optional[List[Text]]:
required_slots = slots_mapped_in_domain + [
"compare_what", "compare_from", "compare_with"]
return required_slots
async def extract_compare_what(
self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict
) -> Dict[Text, Any]:
# get the entities
extracted_ents = CustomEntityExtractor.get_entity(
tracker.latest_message['entities'])
what_compare = extracted_ents.get('what_compare')
return {"compare_what": what_compare}
async def extract_compare_from(
self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict
) -> Dict[Text, Any]:
# get the entities
extracted_ents = CustomEntityExtractor.get_entity(
tracker.latest_message['entities'])
from_compare = extracted_ents.get('from_compare')
return {"compare_from": from_compare}
async def extract_compare_with(
self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict
) -> Dict[Text, Any]:
# get the entities
extracted_ents = CustomEntityExtractor.get_entity(
tracker.latest_message['entities'])
with_compare = extracted_ents.get('with_compare')
return {"compare_with": with_compare}