⚠️ Still WIP: API is unstable and might change. Consider this a technical preview.
Simple Node.js wrapper around the Rasa core HTTP server.
npm install --save rasa-client
const RasaClient = require('rasa-client')
// first param is the endpoint without trailing slash
// optionally the second parameter can be an authentication token
const rc = new RasaClient('http://localhost:5005')
rc.parse('Hello world').then((res) => console.log)
rc.getVersion().then((res) => console.log)
// Full example with the remotebot example (from the official Rasa core repo)
const SENDER_ID = 'anon'
// Greet the bot
const msg1 = 'hello'
rc.parse(msg1, SENDER_ID).then(reply => {
return rc.continue({
executed_action: 'greet'
}, SENDER_ID)
}).then(cont1 => {
// next_action is action_listen in this case
// therefore we can initiate a new parse request
// Send venues request
const msg2 = 'Whats the next event'
return rc.parse(msg2, SENDER_ID)
}).then(reply => {
return rc.continue({
executed_action: 'search_concerts',
events: [{ event: 'slot', name: 'venues', value: [
{name: "Big Arena", reviews: 4.5},
{name: "Small Arena", reviews: 4.2}
]}]
}, SENDER_ID)
}).then(cont2 => {
// you get the point...
})