howdyai / botkit-middleware-witai

Middleware for using Wit.ai with Botkit-powered bots
MIT License
87 stars 49 forks source link

added intent validator, intent post processor, context handler and de… #24

Open manojkumar1412 opened 7 years ago

manojkumar1412 commented 7 years ago

…faultEars

  1. Context Handler - A context handler interface to get the context object and send it to wit, It has a function with below signature function getContext(bot, message); - return context object
  2. defaultEars - If wit fails to give any intent then this may help to do some processing over wit, may be a regex based botkit defaultEars can be used to do regex matching if wit fails
  3. validateIntent - a Validate Intent interface to validate the intent from wit, it requires to do some validation over it. function validateIntent(entities) - return true if valid else false
  4. postProcessIntent - a post process intent interface to do some post processing over wit intent function postProcessIntent(entities) - return entities after post processing