Hi,
I am building a contextual bot. In order to answer the current question, bot needs the previous contextual data. So, how can I get the value of previously set slot in the current form action?
PS: Bot has only 1 slot, so I want the previous slot value to proceed.
@k1m
Conversation flow you mentioned is correct.
Even if I don’t use forms, how will I get the previous value of slot(as it will be holding the current extracted value)?. I need this because my current conversation depends on previous slot value.
Example story:
user: Can I get a version?
bot : Sure, which version you want? - ver1, ver2, ver3?
user: ver2
bot: 2.2.3
user: show me rollback version
bot: ver2 doesn’t have rollback only ver1 has
So here bot needs to remember which version user has asked first only then it can give answer for rollback version.
If you know any alternate way to do this, kindly suggest that too.
I am new to rasa and doesn’t know how to train bot for contextual data
@IgNoRaNt23
Off-course we use this method to get slot value, but here ver1, ver2, ver3, rollback version belongs to same slot named “version_type”. So in this case, how can we get the value of previous value of slot.
Maybe its me, but that example story doesn’t help to understand your problem at all. Where does the slot get set the first time? Where does it get set to something else?
After all the whole conversation is on the tracker, so you might retrieve it, but that gets ugly. And it’s probably not the way its supposed to be done.
The first time it would work using only one slot, but the second time it would skip the form because a slot is already set.
Here you can’t clear the slot at the end of the form because you need the slot if the user asks for a rollback version. If everything would happen inside the form you could clear all slots at the end and use only one slot.
Why to use form to get the version? You can validate user input.
If the user would ask for a weather, you could just take the entities(city/location) in the user message and run a custom action.