New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

rasa-client

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rasa-client

Rasa Core HTTP client (unofficial)

latest
npmnpm
Version
0.8.3
Version published
Maintainers
1
Created
Source

Travis npm Release xo-code-style Badges Beevelop

Rasa Core HTTP Client for Node.js :bird:

:warning: Still WIP: API is unstable and might change. Consider this a technical preview.

Simple Node.js wrapper around the Rasa core HTTP server.

Installation

Install via npm:

npm install --save rasa-client

Usage

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)

API documentation

Examples

// 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...
})

Keywords

rasa

FAQs

Package last updated on 09 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts