wingbot 3.66.1 → 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
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);
|
package/src/BotApp.js
CHANGED
|
@@ -39,7 +39,6 @@ const DEFAULT_API_URL = 'https://orchestrator-api.wingbot.ai';
|
|
|
39
39
|
* @prop {Function} [fetch]
|
|
40
40
|
* @prop {ChatLogStorage} [chatLogStorage]
|
|
41
41
|
* @prop {boolean} [preferSynchronousResponse]
|
|
42
|
-
* @prop {boolean} [deferLogs]
|
|
43
42
|
* @prop {AuditLog} [auditLog]
|
|
44
43
|
* @prop {TlsOptions} [tls]
|
|
45
44
|
*
|
|
@@ -92,7 +91,7 @@ class BotApp {
|
|
|
92
91
|
} = options;
|
|
93
92
|
|
|
94
93
|
this._returnSenderOptions = {
|
|
95
|
-
dontWaitForDeferredOps: processorOptions.
|
|
94
|
+
dontWaitForDeferredOps: processorOptions.dontWaitForDeferredOps,
|
|
96
95
|
textFilter,
|
|
97
96
|
logStandbyEvents,
|
|
98
97
|
confidentInputFilter
|
|
@@ -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
|
|