can anyone describe in a two words, how can i create a story based on a category slot value? for example i set a slot in a previous conversations or in action via api (i can call external api and get a value for a slot) and now I have a slot value but i can’t understand how to “fired” necessary story or fired necessary checkpoint?
Demo use case:
slots:
account_type:
type: categorical
values:
- premium
- basic
stories:
steps:
- intent: utter_greet
- action: action_fetch_profile
- slot_was_set:
- status: basic
- action: utter_welcome_basic
May be something like this you must have done for your action:
from rasa_core.actions import Action
import requests
class FetchProfileAction(Action):
def name(self):
return "fetch_profile"
def run(self, dispatcher, tracker, domain):
url = "http://myprofileurl.com"
data = requests.get(url).json
return [SlotSet("account_type", data["account_type"])]
Try as you asked in two words, so much pressure that’s what you looking or my bad
Thx And do you have any suggestion for situation if this slot was seted earlyer? I can check slot value in a action, but how i can select necessary story?
@Kosechok the above action file as you can see it setting the slot and that slot you using for the next story? Or I get you wrong?
You are correct, but i’m talking about another case, I already have stored slot (set it in another story) And now I must check if slot stored(if not i will ask user and store id), and if i have a slot i should continue necessary story
@Kosechok did you tried the above suggestion? even try use rasa interactive
and see what’s going on.
@Kosechok Heya! I hope you doing fine, are you able to solve this issue?
@nik202 thx i will test it a little later, i’ll be back with a results
@Kosechok No worries. Hope this will solve your issue, if it work please close this thread or shared your own solution for others. Good Luck!