0.0.4 • Published 2 years ago

rasajs v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Creating a Chatbot for Rasa with Node.js

Introduction

Rasa is an open source conversational AI framework that allows developers to build and deploy chatbots and voice assistants. Rasa offers several language-specific APIs to interact with the framework, including a Node.js API.\ The Rasa Node.js API allows you to integrate Rasa into your Node.js applications and interact with your Rasa chatbot or voice assistant through HTTP requests. With this API, you can send messages to your chatbot, receive responses, and track conversation history.

Installation

To use the Rasa Node.js API, you'll need to install the rasajs package, which is a rasa api that gives you access rasa server. Install it by running npm by running the following command:

npm i rasajs

Import

Once you have rasajs installed, you can use it to send HTTP requests to your Rasa server.

import rasa from 'rasajs';
or
const rasa= require('rasajs');

Setup

After import you have to initialize the url of rasa

rasa.baseUrl("http://localhost:5005");

Chat With Rasa

rasa.sendMessage("hi",res=>{
   console.log(res);
});

Answer should be in json format

{ text: 'hi', reply: 'Hey! How are you?' }

Functions

rasa.parseModel

rasa.parseModel: (message: string, callback: Function) => void

rasa.sendMessage

rasa.sendMessage(message: string, callback: Function): Promise<void>

rasa.entry

rasa.entry: () => void

rasa.addEvent

rasa.addEvent: (eventname: string, callback: Function) => void

rasa.resetEvent

rasa.resetEvent: (eventname: string, callback: Function) => void

rasa.ConversionTracker

rasa.ConversionTracker: (callback: Function) => void

rasa.chatHistory

rasa.chatHistory: (callback: Function) => void

rasa.replayDomain

rasa.replayDomain: (name: string, callback: Function) => void

rasa.injectIntent

rasa.evaluateStories: (name: string, callback: Function) => void

rasa.evaluateStories

rasa.evaluateStories: (name: string, callback: Function) => void

rasa.replaceModel

rasa.replaceModel: (path: string, callback: Function) => void

rasa.version

rasa.domain: (callback: Function) => void

rasa.domain

rasa.domain: (callback: Function) => void

rasa.status

rasa.status: (callback: Function) => void

rasa.baseUrl

rasa.baseUrl: (url: string) => void
0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago