wingbot 3.66.2 → 3.66.3

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.66.2",
3
+ "version": "3.66.3",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Ai.js CHANGED
@@ -199,11 +199,13 @@ class Ai {
199
199
  if (typeof model === 'string') {
200
200
  // @ts-ignore
201
201
  modelObj = new WingbotModel({
202
- model
202
+ model,
203
+ prefix
203
204
  }, this.logger);
204
205
  } else {
205
206
  // @ts-ignore
206
207
  modelObj = model;
208
+ modelObj.prefix = prefix;
207
209
  }
208
210
 
209
211
  this._keyworders.set(prefix, modelObj);
@@ -33,6 +33,7 @@ class CachedModel extends CustomEntityDetectionModel {
33
33
 
34
34
  /**
35
35
  * @param {object} options
36
+ * @param {string} [options.prefix]
36
37
  * @param {number} [options.cacheSize]
37
38
  * @param {number} [options.cachePhrasesTime]
38
39
  * @param {{ warn: Function, error: Function, log: Function }} [log]
@@ -67,6 +67,7 @@ const { iterateThroughWords } = require('../utils/ai');
67
67
  * @param {string} text
68
68
  * @param {DetectedEntity[]} entities
69
69
  * @param {number} startIndex
70
+ * @param {string} prefix
70
71
  */
71
72
 
72
73
  /**
@@ -90,12 +91,15 @@ class CustomEntityDetectionModel {
90
91
 
91
92
  /**
92
93
  * @param {object} options
94
+ * @param {string} [options.prefix]
93
95
  * @param {{ warn: Function, error: Function, log: Function }} [log]
94
96
  */
95
97
  constructor (options, log = console) {
96
98
  this._options = options;
97
99
  this._log = log;
98
100
 
101
+ this.prefix = options.prefix;
102
+
99
103
  this._entityDetectors = new Map();
100
104
 
101
105
  /**
@@ -399,7 +403,7 @@ class CustomEntityDetectionModel {
399
403
  let entities = prevEnts.slice();
400
404
  if (this.wordEntityDetector) {
401
405
  for (const [s, startIndex] of iterateThroughWords(text, this.maxWordCount)) {
402
- this.wordEntityDetector(s, entities, startIndex);
406
+ this.wordEntityDetector(s, entities, startIndex, this.prefix);
403
407
  }
404
408
  }
405
409
 
@@ -37,6 +37,7 @@ class WingbotModel extends CachedModel {
37
37
 
38
38
  /**
39
39
  * @param {object} options
40
+ * @param {string} [options.prefix]
40
41
  * @param {string} [options.serviceUrl]
41
42
  * @param {string} [options.trainingUrl]
42
43
  * @param {string} options.model