Add filters
manthanhd opened this issue · comments
Filters are functions that can be run before the request makes it to the skills. This is pre-classification so the filter can get the basic metadata like the sentence etc.
A filter once set runs for every call, every time.
var myfilter = new RequestFilter(function(context, request, response, next) {
...
return next();
});
At what point does a filter get executed?
Filters can be configured at bot creation time. Something in options like this:
{
filters: [sentenceSplitterFilter, badWordsFilter]
}
Filters can be executed immediately when the bot receives a resolution request. They can help modify request or response objects.
This work can be split into two pieces:
- Add the ability for people to add filters in general while keeping the multiple sentences bit in.
- Extract multiple sentence parser into its own filter.