@indra.ai/deva 1.54.6 → 1.54.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -734,9 +734,10 @@ class Deva {
|
|
|
734
734
|
describe:
|
|
735
735
|
***************/
|
|
736
736
|
question(TEXT=false, DATA=false) {
|
|
737
|
+
if (!this._active) return Promise.resolve(this._messages.offline); // resolve with offline message when not active.
|
|
738
|
+
if (!TEXT || typeof TEXT !== 'string') return Promise.resolve(this._messages.notext); // resolve with the no text message if the client says nothing.
|
|
739
|
+
|
|
737
740
|
const id = this.uid(); // generate a unique id for transport.
|
|
738
|
-
// check the active status
|
|
739
|
-
if (!this._active) return Promise.resolve(this._messages.offline);
|
|
740
741
|
this.zone('question', id.uid);
|
|
741
742
|
this.action('question', id.uid);
|
|
742
743
|
const t_split = TEXT.split(' '); // split the text on spaces to get words.
|
|
@@ -762,9 +763,8 @@ class Deva {
|
|
|
762
763
|
key = this.agent().key; // set a temporary key from the agent key.
|
|
763
764
|
|
|
764
765
|
return new Promise((resolve, reject) => {
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
this.state('try', `${method}:${id.uid}`);
|
|
766
|
+
|
|
767
|
+
this.state('try', `${method}:${id.uid}`); // set state to try for process.
|
|
768
768
|
try { // try to answer the question
|
|
769
769
|
if (isAsk) { // determine if hte question isAsk
|
|
770
770
|
// if:isAsk split the agent key and remove first command character
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "23221940810208468106",
|
|
3
3
|
"name": "@indra.ai/deva",
|
|
4
|
-
"version": "1.54.
|
|
4
|
+
"version": "1.54.10",
|
|
5
5
|
"description": "Deva Core a Vedic-inspired Event Based Context Aware Feature, Zone, Action, and State Machine integrated Artificial Intelligence Framework",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"license": "VLA:23221940810208468106 LICENSE.md",
|