manthanhd / talkify

Talkify is an open source framework with an aim to standardize and model conversational AI enabling development of personal assistants and chat bots. The mission of this framework is to make developing chat bots and personal assistants as easy as spinning up a simple website in html.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  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.