Set entity explicitly via text input / message

(martin.m) #1

Hi everyone,

Since it is possible to send intents to rasa core directly (i.e. without writing any “real” text) by putting / in front of the intent, like /greet for example, is there also a way to pass an entity with the intent in this format, e.g. /provide_info(restaurant:chinese) ?

Most channels have the ability to present the user with buttons, and the payload which is sent back to rasa when a specific button is clicked needs to be specified. Passing an entity like shown above would make it unnecessary to train an entity extractor on the entity in question when this entity is just used with buttons. Thanks!

Best, Martin

(Ella Rohm-Ensing) #2

Yes you can! You were very close with the syntax, actually. try

/provide_info{"restaurant": "chinese"}

Example here:

Your input ->  /request_restaurant{"cuisine": "spanish"}
2019-05-17 17:14:44 DEBUG    rasa.core.processor  - Received user message '/request_restaurant{"cuisine": "spanish"}' with intent '{'name': 'request_restaurant', 'confidence': 1.0}' and entities '[{'entity': 'cuisine', 'start': 19, 'end': 41, 'value': 'spanish'}]'