JSPM

smart-assistant

0.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q21939F
  • License ISC

A smart assistant

Package Exports

  • smart-assistant

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 (smart-assistant) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Smart assistant

You can use this module for create assistants, chatassistants, etc.

Install

npm install --save smart-assistant

Or

yarn add --save smart-assistant

Usage

const SmartAssistant = require('smart-assistant');

const assistant = new SmartAssistant(
  ['pt', 'en']  // List of supported languages
);

(async () => {

  await assistant.train(
    './model.nlp',// Path to the model, default: ./model.nlp
    './mind/documents.txt', // Path to the documents, default: ./mind/documents.txt
    './mind/answers.txt' // Path to the answers, default: ./mind/answers.txt
  );
  assistant.say('Trained');

  assistant.onConsole(); // Start the console
  // Or
  const answer = assistant.answer('How are you?'); // Answer to a question
})();