@nlpjs/console-connector
Advanced tools
Comparing version 4.0.0-rc.10 to 4.0.0-rc.12
{ | ||
"name": "@nlpjs/console-connector", | ||
"version": "4.0.0-rc.10", | ||
"version": "4.0.0-rc.12", | ||
"description": "Console Connector", | ||
@@ -28,5 +28,5 @@ "author": { | ||
"dependencies": { | ||
"@nlpjs/core": "^4.0.0-rc.10" | ||
"@nlpjs/core": "^4.0.0-rc.12" | ||
}, | ||
"gitHead": "575769bb2021d6c0629ffbd5b326334b719d40d5" | ||
"gitHead": "7ea0bf4d5fb079352f11d441fd08b3817c3f0855" | ||
} |
@@ -70,3 +70,3 @@ /* | ||
hear(line) { | ||
async hear(line) { | ||
if (this.onHear) { | ||
@@ -78,5 +78,19 @@ this.onHear(this, line); | ||
if (pipeline) { | ||
this.container.runPipeline(pipeline, { message: line }, this); | ||
this.container.runPipeline( | ||
pipeline, | ||
{ message: line, channel: 'console', app: this.container.name }, | ||
this | ||
); | ||
} else { | ||
console.error(`There is no pipeline for ${name}`); | ||
const nlp = this.container.get('nlp'); | ||
if (nlp) { | ||
const result = await nlp.process({ | ||
message: line, | ||
channel: 'console', | ||
app: this.container.name, | ||
}); | ||
this.say(result.answer); | ||
} else { | ||
console.error(`There is no pipeline for ${name}`); | ||
} | ||
} | ||
@@ -83,0 +97,0 @@ } |
9431
128
Updated@nlpjs/core@^4.0.0-rc.12