Then in my actions.py, I defined:
def slot_mappings(self):
return {“num_1”: self.from_entity(entity=“num”, intent=“caculate”),
“num_2”: self.from_entity(entity=“num”, intent=“caculate”)}
‘num’ is entity recognized correctly by the intent ‘caculate’. However, when I run it, it reports:
2019-06-26 19:53:35 INFO rasa_sdk.interfaces - Tried to access non existent slot ‘num_1’
2019-06-26 19:53:35 INFO rasa_sdk.interfaces - Tried to access non existent slot ‘num_2’
According to the documentation, it says custom mapped slot should also be specified in stories. However, how to specify it? The current examples all are categorical or bool values, so that it can specify the slot as a dictionary.However, in my case, the “num_1” and “num_2” are two numbers used in a caculator, whose values are unknown, and can’t be specified beforehand.
My story looks like:
## caculate
* caculate
- action_caculate
Should I include the slots below “action_caculate”? If yes, what’s the correct format?
if it is derived from Action, then you should be able to use my story suggestion.
The 59376 is just an arbitrary sample that tells the story, that it should/could expect not only a triggered intent rather than an intent and an entity. If you mention “5555” instead in your utterance, then the slot would be filled accordingly.