wingbot 3.33.2 → 3.34.0

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.33.2",
3
+ "version": "3.34.0",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -468,6 +468,7 @@ class CustomEntityDetectionModel {
468
468
  return {
469
469
  text: cleanText,
470
470
  intents: [],
471
+ // @ts-ignore
471
472
  entities
472
473
  };
473
474
  }
@@ -615,6 +616,28 @@ class CustomEntityDetectionModel {
615
616
  return this;
616
617
  }
617
618
 
619
+ /**
620
+ * Sets options to entity detector.
621
+ * Useful for disabling anonymization of local system entities.
622
+ *
623
+ * @param {string} name
624
+ * @param {object} options
625
+ * @param {boolean} [options.anonymize]
626
+ * @returns {this}
627
+ * @example
628
+ *
629
+ * ai.register('wingbot-model-name')
630
+ * .setDetectorOptions('phone', { anonymize: false })
631
+ * .setDetectorOptions('email', { anonymize: false })
632
+ */
633
+ setDetectorOptions (name, options) {
634
+ if (!this._entityDetectors.has(name)) {
635
+ throw new Error('Can\'t set entity detector options. Entity "name" does not exist.');
636
+ }
637
+ Object.assign(this._entityDetectors.get(name), options);
638
+ return this;
639
+ }
640
+
618
641
  async getPhrases () {
619
642
  return this._getPhrases();
620
643
  }