I want to set value of ‘color’ with that of another slot ‘color_suggestion’, when user give affirm intent to earlier suggestion. how to do it?
sample dialog:
User: pls suggest the color
## in custom action get a color suggestion. color_suggestion slot is set to Red.
bot: Red looks great on you.
user: please go ahead. ## on affirmation, I want to set Color slot from color_suggestion
I am trying to set in slot_mappings
“color”: [ self.from_entity(entity=“COLR”,intent=“choose_color”),
self.from_intent(intent=“affirm”,---- I want to get value of color_suggestion slot and set it to color---- ),]
to do this you’ll have to create your own slot extraction method, so instead of from_entity it’ll be from_affirmation_of_another_slot or something like that. That will look like the from_intent method except take the value from the other slot
Thanks for your reply. It helped me explore more on this issue.
If I had to implement my own slot extraction method, I had to override methods like extract_requested_slot to handle new mapping method type. Instead, I have done the following:
On affirm intent, set slot value as “slot:color_suggestion” :