Selecting a Value from mulitple Values that have been retrieved through an API Call without prior knowledge over the values

Hey there, I’m quite new to Rasa and the Rasa Community, so apologies in advance if this is a stupid question, but I’m having a hard time wrapping my head around it.

Imagine the following scenario: In the first step the Bot is retrieving values from a database given a key through the user. In the next step the Bot shows the user the values, that have been stored in a list_slot(?) through the custom action. Now the user wants to select an option.

Whats a good way for the user to select an option without having prior knowledge over what values the list might contain? Is there an option to make these values clickable for the user? How about the usage of text given that we don’t know what the values might look like - that’s not really possible is it? Because we never trained the model on these unknown values, or can I still somehow use the NLU to find the closest fitting word compared to the values?

This problem feels rough to me and I haven’t come up with an elegant solution so far. I appreciate any help I can get very much.

Hi @pdeek, as far as I understand for every user you are maintaining a key and also list of values for that key in the database. When the user first interacts with the bot, based on the key of the user we need to display list of options that are stored in database or list slot. User has to choose one of the option and the story has to continue.

If I understand it clearly, it is completely possible with Rasa. You need to override action_session_start method of rasa default actions to fetch the list of options about the user and display them through buttons and payloads.

If it seems overcomplicated, I am sorry. But yeah, it can be done.

Uday

Thank you very much for your reply, I think displaying buttons is the way to go. But just theoretically, what would I need to do to have a robust way to let the user select an option through text?

Let’s say the options are “Option x, Option y, Option z”. What steps would be required to achieve that the user can select an option by typing something like “Please lock in x” or “I’ll take the first option”.

Like you’ve said, I would probably save me quite some work by just using plain buttons, but how much more work would it need to have a user select an option through text?

Thanks again!

Yes. User can also reply with text. In that case, you need to write stories based on your logic. For example,

You can define 3 intents with each intent specifying different ways to choose options.

intent: option1

  • choose option 1
  • lock first one
  • i want to go with first one …

Similarly, you create intents for option2 and option3 as well.

Then in your stories, write like this

##Select option 1

  • session_start
    • utter_question
  • option1
    • action_custom_option1

##Select option 2

  • session_start
    • utter_question
  • option2
    • action_custom_option2

##Select option 3

  • session_start
    • utter_question
  • option3
    • action_custom_option3

You can write whatever you want in your custom actions. You can make the bot even more contexual using slots as well.

I will be more active on LinkedIn. Feel free to connect by writing a personal invite.

Uday

The problem with this approach is that I don’t know how many options there are to choose from, I also don’t know what values they might have. Thus I’m concluding a payload with buttons to choose an option is the only elegant way to handle this.

I hope I haven’t missed anything, thanks a lot for taking your time to help me with my problem.

Never mind. If you like my answer, kindly mark the answer as accepted solution so that it will be helpful for someone who have the same use case.