@nlpjs/slot
Advanced tools
Comparing version 4.25.0 to 4.26.0
{ | ||
"name": "@nlpjs/slot", | ||
"version": "4.25.0", | ||
"version": "4.26.0", | ||
"description": "Slot filling manager", | ||
@@ -27,3 +27,3 @@ "author": { | ||
}, | ||
"gitHead": "3065165b42ea2160d2a27c10c412c4b4c491332a" | ||
"gitHead": "5d3f12ccb34890b4f358af85b4617a0d07197027" | ||
} |
@@ -148,2 +148,12 @@ /* | ||
/** | ||
* Given an intent return the information if the intent has entities defined | ||
* | ||
* @param {String} intent Name of the intent. | ||
* @returns {boolean} true if intent has defined entities, else false | ||
*/ | ||
hasIntentEntities(intent) { | ||
return this.getIntentEntityNames(intent).length > 0; | ||
} | ||
/** | ||
* Clear the slot manager. | ||
@@ -247,3 +257,2 @@ */ | ||
const entity = result.entities[i]; | ||
console.log('handle entity', entity.option, entity.entity, aliases[i]); | ||
// Remove existing mandatory entities to see what's left | ||
@@ -266,2 +275,3 @@ delete mandatorySlots[entity.entity]; | ||
len: result.utterance.length, | ||
isSlotFillingFallback: true, | ||
}); | ||
@@ -271,2 +281,5 @@ delete mandatorySlots[context.slotFill.currentSlot]; | ||
keys = Object.keys(mandatorySlots); | ||
if (context.slotFill && context.slotFill.currentSlot) { | ||
context.slotFill.latestSlot = context.slotFill.currentSlot; | ||
} | ||
if (!keys || keys.length === 0) { | ||
@@ -286,2 +299,3 @@ // All mandatory slots are filled, so we are done. No further questions needed | ||
srcAnswer: result.srcAnswer, | ||
latestSlot: context.slotFill.latestSlot, | ||
}; | ||
@@ -288,0 +302,0 @@ const currentSlot = mandatorySlots[keys[0]]; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12892
314