Waiting for user response in story

Hello,

So my requirement is that I want to wait for user response or more like action_listen in a story. So let’s say I have a story as:

stories:
- story: user path1
    steps:
  - intent: greet
  - action: utter_greet
  - action: utter_ask
  - intent: mood_unhappy
  - action: utter_what
  - action: **listen to what user says**

So at this point I want to add a listener and then pass that message to my custom model to detect the state of user and then depending on the predicted state, I want the conversation to take place.

Can anyone help me on how to do this? Preferably if someone can share some kind of code, it would be helpful because I went through the Rasa docs regarding form and slot filling but I don’t understand how to implement them in what I am trying to do.

Thank You.

action: **listen to what user says** is implicit at every step of the story in which intent is mentioned. The bot always listens to the user.

What do you mean by “custom model”? If you’re talking about a custom component, then every message will pass through it anyway.

What do you mean by “state of the user”? Is it something you can use slots for?

If you want to use slots, look at slot events in stories.

You can use the SlotSet and FollowupAction events to set slots and force a specific next action.

By action listener I mean that, i don’t know the intent of the message user is going to send. It can be anything so I want that message as input to my custom model (pytorch model) which will predict the label (multiclass classification model) and that label i need to use to determine how the conversation follows. So since I don’t know intent of the message how do I wait for the user to enter a message?

Look at from_text slot mapping

Okay Thank you for assistance

1 Like