wingbot 3.68.17 → 3.68.18

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.68.17",
3
+ "version": "3.68.18",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
@@ -304,13 +304,14 @@ class CustomEntityDetectionModel {
304
304
  return zLen - aLen;
305
305
  });
306
306
 
307
+ if (this._options.verbose) this._log.log('#NLP [nonOverlapping]', { entities, expectedEntities, justDuplicates });
308
+
307
309
  let res = [];
308
310
 
309
311
  for (let i = 0; i < entities.length; i++) {
310
312
  const entity = entities[i];
311
313
 
312
314
  const isExpected = expectedEntities.includes(entity.entity);
313
-
314
315
  const duplicate = res
315
316
  .find((e) => e.start === entity.start && e.end === entity.end);
316
317
 
@@ -353,6 +354,10 @@ class CustomEntityDetectionModel {
353
354
  const othersConflict = res.some((e) => putback === e
354
355
  || (e.start < putback.end && e.end > putback.start));
355
356
 
357
+ this._log.log(`#NLP (${i}|${k} [putBack: ${entity.entity}|${putback.entity}] (${i}|${k})`, {
358
+ putback, entity, currentConflict, othersConflict
359
+ });
360
+
356
361
  if (!currentConflict && !othersConflict) {
357
362
  res.push(putback);
358
363
  }
@@ -360,6 +365,12 @@ class CustomEntityDetectionModel {
360
365
  }
361
366
  }
362
367
 
368
+ if (this._options.verbose) {
369
+ this._log.log(`#NLP (${i}) [nonOverlapping| ${entity.entity}:${entity.value}]`, {
370
+ willRemoveEntity: overlapping, overlapping, duplicate, isExpected, entity
371
+ });
372
+ }
373
+
363
374
  if (!overlapping) {
364
375
  res.push(entity);
365
376
  }
@@ -102,7 +102,7 @@ class WingbotModel extends CachedModel {
102
102
  `matches=${encodeURIComponent(this._matches)}`
103
103
  ];
104
104
 
105
- if (this._options.verbose) this._log.log(`#NLP: "${text}" [query]`, { matches: this._matches, localEntities: entities });
105
+ if (this._options.verbose) this._log.log(`#NLP: ${text} [query]`, { matches: this._matches, localEntities: entities });
106
106
 
107
107
  if (entities) {
108
108
  const buf = await this._brotli(Buffer.from(JSON.stringify({ entities })));
@@ -123,7 +123,7 @@ class WingbotModel extends CachedModel {
123
123
 
124
124
  const response = await res.json();
125
125
 
126
- if (this._options.verbose) this._log.log(`#NLP: ${text} [response]`, { response });
126
+ if (this._options.verbose) this._log.log(`#NLP: ${text} [response]`, response);
127
127
 
128
128
  if (res.status >= 300) {
129
129
  this._log.warn(`AI query failed: ${response.message || res.statusText}`);