hossa95
(Hossa95)
February 10, 2019, 4:04pm
1
I am making a bot for cars … lets say i have 3 slots to take from user (Make, Model, Year)
but if I take for example the Model
from user I want to fill the Make
slot manually by some value and don’t ask the user for it
How can I do this?
I tried this approach in the required_slots()
:
if tracker.get_slot('carYear'):
SlotSet('Make', "value")
return ["Make", "Model", "Year"]
but the Make
slot isn’t filled and the bot asks for it… any better ideas?
You have to return the SlotSet method in the function for the slot to get set.
if tracker.get_slot('carYear'):
return [SlotSet('Make', "value")]
hossa95
(Hossa95)
February 11, 2019, 11:16am
3
but this function should return the required slots not SlotSet()?
Oh sorry, I interpreted your question in a wrong way.
Anyway, you can only set the value of a slot by returning it. What if you remove the Model slot from required slots and maybe fill that slot later in a custom action?
1 Like
hossa95
(Hossa95)
February 11, 2019, 11:27am
5
looks like a nice approach … but you recommend fill it in the validation function?
Yea, you can try that out too. That way you won’t have to trigger another action, it should be possible to fill in in the validate method.
1 Like
hey how do u return slot value to be used for the next action in custom aciton??
You can use the tracker to access the slots anytime in any custom actions.