JSPM

@itsbth/eliza-as-promised

0.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q34307F
  • License MIT

Eliza psychotherapist in Node.js as a promised based AI

Package Exports

  • @itsbth/eliza-as-promised

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@itsbth/eliza-as-promised) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

eliza-as-promised

Adaptation of http://www.masswerk.at/elizabot/ to a promised based node.js module.

elizabot.js v.1.1 - ELIZA JS library (N.Landsteiner 2005) Eliza is a mock Rogerian psychotherapist. Original program by Joseph Weizenbaum in MAD-SLIP for "Project MAC" at MIT. cf: Weizenbaum, Joseph "ELIZA - A Computer Program For the Study of Natural Language Communication Between Man and Machine" in: Communications of the ACM; Volume 9 , Issue 1 (January 1966): p 36-45. JavaScript implementation by Norbert Landsteiner 2005; http://www.masserk.at

Usage

const Eliza = require('eliza-as-promised');

var eliza = new Eliza();

// start an Eliza conversation
console.log('>> ' + eliza.getInitial());

// tell Eliza something
let statement = 'I need some help';
console.log('<< ' + statement);

// let Eliza respond
// will respond with response.final if you're done
// will respond with response.reply if you still need more therapy
eliza.getResponse(statement)
  .then((response) => {
    if (response.reply) {
      console.log('>> ' + response.reply);
    }
    if (response.final) {
      console.log('>> ' + response.final);
      process.exit(0);
    }
  });

// repeat getResponse() over and over till response.final is defined