Filling slots based on pervioes slots

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")]

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

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