How do I just collect a user response in Rasa Core without extracting an entity? Right now I have been able to
doing the following, but I am wondering if there is a better way?
domain.yml
slots:
slot: animal
type: categorical
values:
- cat
- dog
stories.md
*greet
-utter_greet
*inform{"Animal":"Dog"}
- utter_hello_fido
*inform
- do_my_action
python code:
class MyAction(Action):
def name(self):
return 'do_my_action'
def run(self):
message = tracker.latest.text
operate on(message)
return []
deepshet
(Deepak Shetty)
August 26, 2018, 9:53pm
2
Its not clear what your question is. If you mean you just want whatever the user entered then what you are showing in code is correct
akelad
(Akela Drissner)
August 27, 2018, 8:45am
3
This is how we would generally do it yes, but the code in run should be:
def run(self, dispatcher, tracker, domain):
message = tracker.latest_message.text
return [SlotSet('slot_name', message)]
3 Likes
Abir
(Abir)
October 14, 2018, 3:05pm
4
Is there any similar approach to find the corresponding bot reply??
akelad
(Akela Drissner)
October 16, 2018, 4:34pm
5
you can get the tracker.latest_action
for the latest action that was run
3 Likes