I am having a problem for more than a month now in switching between two intents.
I have this case: carSearch intent with carSearch_form and bookAppointment intent with bookAppointment_form
I want to allow user to switch between the two intents in the middle of one of them.
for example:
the user is in bookAppointment intent when the next slot and the requested slot is phone_number … he can write i want to buy a car which trigger the carSearch intent and open the carSearch_form
I wrote two stories but each has it’s own problem
the first: the problem here is if the user didn’t provide any entities in the sentence the core gives a circuit breaker and failed to do anything i want to buy a Toyota works fine while I want to buy a car fails
## book appointment to car search switching
* bookAppointment
- bookAppointment_form
- form{"name": "bookAppointment_form"}
* carSearch
- carSearch_form
- form{"name": "carSearch_form"}
- form{"name": null}
- form{"name": null}
- action_carSearch
the second: works fine in both sentences but forget any entities captured in the sentence like i want to buy a corolla the corolla is extracted from the nlu but never saved in the slots
@hossa95 I think there is problem in your action form.
def slot_mappings(self):
# type: () -> Dict[Text: Union[Dict, List[Dict]]]
"""A dictionary to map required slots to
- an extracted entity
- intent: value pairs
- a whole message
or a list of them, where a first match will be picked"""
return {"cuisine": self.from_entity(entity="cuisine",
not_intent="chitchat"),
"num_people": [self.from_entity(entity="num_people",
intent=["inform",
"request_restaurant"]),
self.from_entity(entity="number")],
"outdoor_seating": [self.from_entity(entity="seating"),
self.from_intent(intent='affirm',
value=True),
self.from_intent(intent='deny',
value=False)],
"preferences": [self.from_intent(intent='deny',
value="no additional "
"preferences"),
self.from_text(not_intent="affirm")],
"feedback": [self.from_entity(entity="feedback"),
self.from_text()]}
Recheck your slot maping. what how you find the slot.