talkify icon indicating copy to clipboard operation
talkify copied to clipboard

Add filters

Open manthanhd opened this issue 9 years ago • 2 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();
});

manthanhd avatar Oct 28 '16 14:10 manthanhd

At what point does a filter get executed?

manthanhd avatar Nov 10 '16 14:11 manthanhd

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:

  1. Add the ability for people to add filters in general while keeping the multiple sentences bit in.
  2. Extract multiple sentence parser into its own filter.

manthanhd avatar Feb 08 '17 21:02 manthanhd