Rasa form, turn entire line into entity

Hello everyone and thanks in advance for the help!

I am building a form with Rasa and it is extracting all the entities I want but there is a case in which the entity should be the entire line written by the user in the chat, so is there a way to tell Rasa form to set an entity value to the entire text written by the user?

Thanks!

I will do this in custom extract function extract_slot_name, which can get last message and set slot value.

Hello! I’m sorry but I didn’t understand your answer, could you explain further?

Welcome to the forum :slight_smile:

Please read about from_text mapping for slots.

Or, in a Custom Action, you can use the SlotSet event to set the slot’s value to tracker.latest_message[‘text’]:

class MyCustomAction(Action):
    def name(self):
        return "action_name"

    async def run(self, dispatcher, tracker, domain):
        return [SlotSet('name_of_your_slot', tracker.latest_message['text'])]
1 Like

Thank you very much Chris! That did the trick!

1 Like