Hi,
I am trying to set a slot when the user presses a button. I tried a couple of methods but didn’t work. Not sure what I am missing. To clarify, I am not using any forms, as I have just one single slot to fill. Here are the files:
I first trigger the intent “ss_ask_fitness_regime” to start the story. I get the buttons back from rasa and when the user presses a button, I send the payload back to rasa and check the slot value “attrib_fitness_regime” from the tracker in the action. In my case, it is always None which is wrong.
I tried two ways to send the payload back and both cases failed to set the slot. One is to send the payload as simple text “/yoga{{“attrib_fitness_regime”:“yoga”}}”. Another way I tried is to trigger the intent “/yoga” and supply {“attrib_fitness_regime”:“yoga”} in “entities” as shown in this link: here:Reaching Out to the User
I tried to make the slot categorical instead of text, didn’t work. Not very sure what I am missing here. Any help is appreciated.
Hi,
Using single brackets gives me an error as shown below in Rasa server and the slot is still None. To fix the error someone suggested using double brackets and the error was gone. In one of the github issues, they said this was fixed but I still get that error. I didn’t look into this issue in detail as I just wanted to get this working, so used double brackets. I use rasa docker with image “rasa/rasa:2.8.0-spacy-en”. Even with single brackets, the slot is still None.
Error:
2021-08-28 12:53:50 ERROR rasa.core.nlg.interpolator - Failed to replace placeholders in response '/yoga{"attrib_fitness_regime":"yoga"}'. Tried to replace '"attrib_fitness_regime":"yoga"' but could not find a value for it. There is no slot with this name nor did you pass the value explicitly when calling the response. Return response without filling the response.
Traceback (most recent call last):
File "/opt/venv/lib/python3.8/site-packages/rasa/core/nlg/interpolator.py", line 27, in interpolate_text
text = text.format(values)
KeyError: '"attrib_fitness_regime":"yoga"'
I fixed it. I had to change the story to the following. I was under the impression that if we send buttons, Rasa will wait for a response which is not the case. We have to make it wait by listing all the intents possible in the reponse.