Hi!
I have a Rasa bot running on my website where it guides the users around the site.
This means that in some cases the same question should have different answers and it only depends on where on the site the user is currently.
Is it possible to pass along that information and use it when selecting a response?
There are quite many pages on my site and the questions answered this way would be quite simple so I therefore intend to use the Retrieval Actions for them.
From the top of my head … Technically, yes. It might be involved though.
If you can add a custom component to your pipeline that retrieves features for a specific user, then technically … sure. This is somewhat technically involved though.
Would it be possible to use a lot of Retrieval Actions, one for each page and somehow select the correct one from those?
Or maybe it would be possible to use Knowledge Base Actions somehow?
What do you think?
I see now how I can create a Custom Connector to pass along the page metadata.
However I can’t come up with a good way to use that metadata to select a response.
You mentioned maybe using a custom action or something else. Do you have time to elaborate?
Yeah you can get that metadata from the custom action if you loop through the tracker.events. And then based on the value of that, you can send a different message
Say that a user asks the question:
“What am I supposed to do now?”
From the matadata I see where on the site the user currently is, but how do I set up Rasa in a way so that that information is used to select the correct response? Is it possible?
Okay, it still seams like a very hard problem though. I don’t know if there is anyone else who is interested in an official solution to this problem. Can I do anything to find that out?
I created a Custom Connector that extracts the page id and started working on a Custom Action, but I don’t know what to put in the Custom Action.
For example: I now have the question asked by the user and the page id together
i.e. something like: {“message”: “What am I supposed to do now?”, page_id: 23, …}
How do I use the page id to limit the set of possible responses? I.e. what should i put in the Custom Action?
Hi again @akelad!
You suggested using a custom action, but would it be possible to use a custom nlu component instead?
I tried it but noticed that the metadata is only avaiable in rasa.core.channels.UserMessage not in rasa.nlu.training_data.Message for the input to the process functions.
Can I access the metadata field in custom nlu components in any other way?
Because I use a modified ResponseSelector to select the correct response from a subset of all responses. I want to use the metadata to first filter all response down to that subset.
What’s the reason for doing that? If you want to do something like that, you may be better off not using the ResponseSelector, but regular intents instead
Would regular intents be better?
The problem that i have is that users can ask simple questions like “Where do i click now?” or “What should I write here?” etc. and they can do that on many different pages on my website. Those questions should have different answers depending on where on the website they are. I therefore pass along a page id in the metadata that i want to use to limit the response selection to those who belong to that page.
Yeah that would be better handled by regular intents, and then a custom action where you decide what message to send back to the user dependent on the metadata
Wait now I see what you mean!
Hmm, could work but still not optimal since there are thousands of similar but different intents and each intent may only be valid on a few pages. That’s why i would like to do the filtering first.