Git Product home page Git Product logo

botkit-rasa's People

Contributors

sohlex avatar terrytran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

botkit-rasa's Issues

Compatibility with rasa NLU v0.9x

Hi, it seems that there is some problems when using this middleware with rasa NLU >0.7
Whenever you interact with the rasa server, the following error appears:

Unhandled rejection StatusCodeError: 404 - {"error":"Invalid parse parameter specified"}

This error appears after calling the nodeJS program with:
slack_token=XXXXX node bot.js

Rasa is installed using pip, and botkit using npm after cloning the main repository.

Kind regards

LOG

Initializing Botkit v0.5.4
info: ** No persistent storage method specified! Data may be lost when process shuts down.
debug: Setting up a handler for spawned
debug: Setting up a handler for heard_trigger
debug: Setting up a handler for command_triggered
debug: Setting up a handler for remote_command_end
info: ** Setting up custom handlers for processing Slack messages
debug: Setting up a handler for message_received
debug: rtm.connect { token: 'XXXXX' }
info: ** API CALL: https://slack.com/api/rtm.connect
{ receive: [Function: receive], hears: [Function: hears] }
debug: Setting up a handler for direct_message
debug: Setting up a handler for direct_mention
debug: Setting up a handler for mention
debug: Got response null {"ok":true,"url":"wss:\/\/mpmulti-s1ou.slack-msgs.com\/websocketXXXXXXXXXXX=","team":{"id":"XXXXXXXXXX","name":"Slack test","domain":"XXXX-test"},"self":{"id":"U5W5ZP7HC","name":"XXXX-test-bot"}}
notice: ** BOT ID: XXXXXXXXXX-bot ...attempting to connect to RTM!
notice: RTM websocket opened
Unhandled rejection StatusCodeError: 404 - {"error":"Invalid parse parameter specified"}
    at new StatusCodeError (~/example/test_rasa_nlu/botkit-rasa/node_modules/request-promise-core/lib/errors.js:32:15)
    at Request.plumbing.callback (~/example/test_rasa_nlu/botkit-rasa/node_modules/request-promise-core/lib/plumbing.js:104:33)
    at Request.RP$callback [as _callback] (~/example/test_rasa_nlu/botkit-rasa/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at Request.self.callback (~/example/test_rasa_nlu/botkit-rasa/node_modules/request/request.js:188:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (~/example/test_rasa_nlu/botkit-rasa/node_modules/request/request.js:1171:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (~/example/test_rasa_nlu/botkit-rasa/node_modules/request/request.js:1091:12)
    at Object.onceWrapper (events.js:312:19)
    at emitNone (events.js:110:20)
    at IncomingMessage.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1045:12)
    at _combinedTickCallback (internal/process/next_tick.js:102:11)
    at process._tickCallback (internal/process/next_tick.js:161:9)

Unhandled rejection StatusCodeError: 404 - {"error":"Invalid parse parameter specified"}
    at new StatusCodeError (~/example/test_rasa_nlu/botkit-rasa/node_modules/request-promise-core/lib/errors.js:32:15)
    at Request.plumbing.callback (~/example/test_rasa_nlu/botkit-rasa/node_modules/request-promise-core/lib/plumbing.js:104:33)
    at Request.RP$callback [as _callback] (~/example/test_rasa_nlu/botkit-rasa/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at Request.self.callback (~/example/test_rasa_nlu/botkit-rasa/node_modules/request/request.js:188:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (~/example/test_rasa_nlu/botkit-rasa/node_modules/request/request.js:1171:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)

Recognize Bot's messages

Hi!

In order to not sent to rasa the bot reply, this could be added just after

 if (!message.text || message.is_echo) {
        next()
        return
}

we can simply identify whether the message comes from a bot:

if( message.bot_id != null ){
        console.log('\t\t[own_debug]  bot response, not processing')
        next()
        return
}

Hope it helps. Regards

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.