Git Product home page Git Product logo

rasa-client's Introduction

Travis npm Release xo-code-style Status Badges Beevelop

Rasa Core HTTP Client for Node.js ๐Ÿฆ

โš ๏ธ 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)

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

rasa-client's People

Contributors

beevelop avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rasa-client's Issues

Support for dynamic model loads

The current master of Rasa core already contains a new endpoint for a /load request:

Loads a zipped model, replacing the existing one.

Posting a .zip file to /load should therefore enable to swap the models on-the-fly. Unfortunately the described change is not included in the recent 0.8.4 release.

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.