Hello) I hope my question is written right)
I use node.js, nlp.js, direct conector. Right now working with this repository: https://github.com/jesus-seijas-sp/nlpjs-examples
I have task to make bot send messeges in the certain time. How to realize this?:
User: Work?
Bot: Yes
(pause 2 seconds)
Bot: work
I tried to use setTimeout and also make intervals in index.js and pipelines.md, but maybe i did it wrong. Nothing worked and sometimes code was broken.
There in folders quickstart/08.Webchat in file index.js i wrote this:
const { dockStart } = require('@nlpjs/basic');
(async () => { const dock = await dockStart({ use: ['Basic']});
const nlp = dock.get('nlp');
nlp.addLanguage('en');
nlp.addDocument('en', 'Jack', 'greetings.jack');
nlp.addAnswer('en', 'greetings.jack', 'Hi, Jack');
await nlp.train();
const response = await nlp.process('en', 'I should go now');
console.log(response);
})();