Rasa Core - Get Full Message, Custom Action

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 []

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

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

Is there any similar approach to find the corresponding bot reply??

you can get the tracker.latest_action for the latest action that was run

3 Likes