sohlex / botkit-rasa Goto Github PK
View Code? Open in Web Editor NEWA middleware to connect Rasa NLU > 0.8.x to different chat channels using Botkit
Home Page: https://www.npmjs.com/package/botkit-rasa
License: ISC License
A middleware to connect Rasa NLU > 0.8.x to different chat channels using Botkit
Home Page: https://www.npmjs.com/package/botkit-rasa
License: ISC License
The /parse get request can accept a "model" parameter
$ curl 'localhost:5000/parse?q=hello&model=hotels'
$ curl -XPOST localhost:5000/parse -d '{"q":"I am looking for Chinese food", "model": "restaurants"}'
as you can see at https://github.com/RasaHQ/rasa_nlu/blob/master/docs/http.rst
is it possible to manage it in this package?
thanks
matteo
The /parse get request can accept a "project" parameter (instead of the old model parameter)
$ curl 'localhost:5000/parse?q=hello&project=hotels'
$ curl -XPOST localhost:5000/parse -d '{"q":"I am looking for Chinese food", "model": "restaurants"}'
as you can see at https://github.com/RasaHQ/rasa_nlu/blob/master/docs/http.rst
is it possible to manage it in this package?
thanks
matteo
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)
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.