Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filters #13

Open
manthanhd opened this issue Oct 28, 2016 · 2 comments
Open

Add filters #13

manthanhd opened this issue Oct 28, 2016 · 2 comments

Comments

@manthanhd
Copy link
Owner

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
Copy link
Owner Author

At what point does a filter get executed?

@manthanhd
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant