Giter VIP home page Giter VIP logo

Comments (2)

jschnurr avatar jschnurr commented on July 17, 2024

Given where the middleware is called in the Botkit receive pipeline, it doesn't seem practical to do this at the request level; it would need to be applied to all incoming messages consistently.

One option is to accept an array of types in the middleware config, and skip NLP evaluation if the message.type is a match. This is sort of how it works today, though the types are hard coded; specifically we bypass the NLP if the text field is missing, or if the message.type is self_message.

By comparison, the Watson connector also filters out the Slack-specific presence_change and reconnect_url types. The other NLP connectors are generally naive and send almost everything to the NLP service for evaluation.

It would be cleaner to simply provide a configuration property, with defaults. Usage would be as follows:

var dialogflowMiddleware = require('botkit-middleware-dialogflow')({
    token: process.env.dialogflow,
    ignoreType: ['self_message', 'facebook_postback']
});

Is that what you had in mind? @peterswimm, any preference?

from botkit-middleware-dialogflow.

klemensz avatar klemensz commented on July 17, 2024

Yes, that's what I had in mind 👍 I also see that this should be applied to all messages consistently.

The payload of the postback could be a JSON structure for example (we do this in our case to pass on context information), so passing some JSON data to Dialogflow wouldn't make sense.

from botkit-middleware-dialogflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.