1.3.1 • Published 2 years ago

@converseai/plugins-sdk v1.3.1

Weekly downloads
41
License
MIT
Repository
github
Last release
2 years ago

Converse Plugins SDK

This library makes it easy to create your own plugins and modules for the Converse AI platform

Setup Instructions

Converse Plugins SDK

  1. Import the appropriate class(es):
let ConversePluginsSDK    = require('@converseai/plugins-sdk');
  1. Create an http instance:
const app = new ConversePluginsSDK.http({request: request, response: response});

Example Using Express

Javascript

Below is a simple delay module that will delay the conversation.

delayTime is created via the module definition on the ConverseAI platform. If it's undefined then it will delay for 1 second.

const express = require('express')();
const Status  = require('@converseai/plugins-sdk').Status;

express.use(bodyParser.json());

var delayModule = function(app, body) {
  setTimeout(function() {
    app.send(Status.SUCCESS);
  }, body.payload.moduleParam.delayTime || 1000);
}

express.post('/', function (request, response) {
  var app = new ConversePluginsSDK.http({ request, response });

  app.setModules({
    delayModule: delayModule
  });

  app.handleRequest();
});

License

See LICENSE

1.3.1

2 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago