cherry-wit

cherry plugin to interact with wit.ai

Usage no npm install needed!

<script type="module">
  import cherryWit from 'https://cdn.skypack.dev/cherry-wit';
</script>

README

cherry-wit

config

"witd_url": "http://192.168.1.68:8080",
"wit_token": "MY_TOKEN",

api

Produces "from: wit" messages. e.g.

cherry.handle({
  wit: function (message) {
    var plugins = cherry.plugins();
    var intent = message.outcomes[0].intent;

    if (intent === 'lights_on') {
      plugins.hue({on: true});
    } else if (intent === 'lights_off') {
      plugins.hue({on: false});
    } else {
      console.log("unkown intent " + intent);
    }
  }
});