wingbot 3.27.0-alpha.3 → 3.27.0-alpha.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.27.0-alpha.3",
3
+ "version": "3.27.0-alpha.4",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -352,11 +352,11 @@ class CustomEntityDetectionModel {
352
352
  * @param {string} text
353
353
  * @param {string} [singleEntity]
354
354
  * @param {string[]} [expected]
355
- * @param {DetectedEntity[]} [entities] - previously detected entities to include
355
+ * @param {DetectedEntity[]} [prevEnts] - previously detected entities to include
356
356
  * @param {DetectedEntity[]} [subWord] - previously detected entities within words
357
357
  * @returns {Promise<DetectedEntity[]>}
358
358
  */
359
- async resolveEntities (text, singleEntity = null, expected = [], entities = [], subWord = []) {
359
+ async resolveEntities (text, singleEntity = null, expected = [], prevEnts = [], subWord = []) {
360
360
  // mark unknown dependencies as resolved
361
361
  const resolved = new Set(
362
362
  this.getDependentEntities(false)
@@ -364,6 +364,15 @@ class CustomEntityDetectionModel {
364
364
  );
365
365
 
366
366
  let missing = Array.from(this._entityDetectors.keys());
367
+ const entities = prevEnts.map((e) => {
368
+ if (typeof e.text === 'string') {
369
+ return e;
370
+ }
371
+ return {
372
+ ...e,
373
+ text: text.substring(e.start, e.end)
374
+ };
375
+ });
367
376
 
368
377
  while (missing.length !== 0) {
369
378
  let detect = [];