Rasa: Metadata field should be passed through the input channel

Created on 21 Aug 2019  路  6Comments  路  Source: RasaHQ/rasa

To use metadata with the input channel, you currently have to overwrite several functions in the RestInputChannel (e.g. receive, stream_response, on_message_wrapper).

Potential Solution:

  • Would be cool if we implement a function get_metadata(request) which returns None by default, and can be overwritten to return a dict of metadata
  • stream_response, on_message_wrapper should pass on a potential metadata object to UserMessage by default

https://github.com/RasaHQ/rasa/blob/master/rasa/core/channels/channel.py#L398

area type

Most helpful comment

would be good if all the supported channels did this by default also

All 6 comments

@wochinge is that description good enough?

@akelad Changed it a bit

would be good if all the supported channels did this by default also

would be good if all the supported channels did this by default also

Can you clarify that for me?

e.g. here
https://github.com/RasaHQ/rasa/blob/master/rasa/core/channels/facebook.py#L104

it should pass along metadata -- I think maybe by default just the entire payload that comes in with the response, or something like that. So that any information facebook sends to the endpoint gets through to actions and people can do what they want with it

Thanks!

I think maybe by default just the entire payload that comes in with the response, or something like that.

In my opinion that's too much guessing. It would add a lot of overhead for certain channels to the tracker which is only required by a small subset of people. Hence, I'd prefer if we rather clarify how to quickly extend an input channel to get the required information.

Was this page helpful?
0 / 5 - 0 ratings