I want to show thumbs up and thumbs down buttons next to each Rasa reply.
Users can give feedback for any Rasa reply, not just the newest one, at any time (e.g. Rasa has already replied 10x and only now the user gives feedback on the 1st reply).
When the user clicks on a button, we want to add the feedback metadata to the conversation.
When reviewing conversations on Rasa X, messages should show the positive or negative feedback.
I assume I need the following things to achieve this:
A unique message id for each Rasa reply (so the frontend can send {message: "/feedback", feedback: 'positive', messageId: '84898456', sender: '558787778'})
A custom action which can add metadata to the conversation
A way to ignore all feedback intents
Questions I have:
Is there a transformation hook / action which can be automatically called to transform a Rasa reply before sending it to the user, so I can add a message id? (If a user starts the same conversation twice, the id of a message should be different the second time)
How can I add metadata to previous messages, not just the newest one?
This user feedback should not influence the conversation going forward, so I do not want to have it in the conversation history
have a slot feedback with influences_conversation=False and an entity feedback in your domain
when the user sends it you send a message /feedback{"feedback": "positive"} to the input channel
→ feedback gets stored as slot in the conversation and is available in Rasa X
Is there a transformation hook / action which can be automatically called to transform a Rasa reply before sending it to the user, so I can add a message id? (If a user starts the same conversation twice, the id of a message should be different the second time)
Why do you need the message ID? I guess the best place would be a custom output channel.
How can I add metadata to previous messages, not just the newest one?
Conversation events are immutable so that’s not possible.
And only now the user gives positive feedback on answer #2. Then a message id would come in handy. By just sending /feedback{"feedback": "positive"} the custom action cannot know which answer received positive feedback.
I guess I could do this though:
Keep track of the number of Rasa answers in the frontend
Send something like /feedback{"feedback": "positive-2"}
Read that in the custom action and fill the slot of answer #2 retrospectively
the custom action cannot know which answer received positive feedback.
You can actually know as these entities are attached to user message. If you inspect the last user message in the custom action (e.g. via tracker.events) then you can identify which message passed in these values.
I guess what I want is not possible. Just realised slots are per conversation and not per message. I wanted to see feedback per message in Rasa X while reviewing conversations.