Hello everybody,
Is there any way to fill a slot directly by listening the next user input ? I tried to use a FormAction but the result is not the expected one.
Maybe it’s better with an example. Let’s take the example from the Rasa docs : Weather bot.
I want to extract the intent ask_weather and the entity city.
Now let’s get two potential user inputs :
- The user precised the location (Example : What’s the weather in San Francisco ? → Intent = ask_weather / “city” = San Francisco)
- The user didn’t precised the location (Example : What’s the weather ? Intent = ask_weather)
The first line can be tranlated to the following story :
* ask_weather{"location": "San Francisco"} - action_give_weather
For the second line, I want my bot to ask For which city do you want to know the weather ?.
Directly after that, I want the bot to listen the answer and that the next user utterance is directly interpreted as the expected answer and stored in the city slot.
In terms of dialog, the result would be as follows :
- [user] What’s the weather ?
- [bot] For which city do you want to know the weather ?
- [user] San Diego # Slot filling here
- [bot] Here is the weather for San Diego : … # Result from “action_give_weather”
If I’m using a FormAction, I’m forced to detect an “inform” intent, which will potentially be misinterpreted, as follows :
* ask_weather - utter_ask_location - weather_form - slot{"requested_slot": "location"} * inform{"location": "San Diego"} - slot{"location": "San Diego"} - action_give_weather
When scenarios like that are multiplying in the stories, the second intent (inform in the example above) is frequently misinterpreted (because this kind of intents are often composed of a single word).
Thanks in advance for your help