wingbot 3.68.16 → 3.68.17
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 +1 -1
- package/src/Ai.js +8 -2
- package/src/wingbot/CachedModel.js +1 -0
package/package.json
CHANGED
package/src/Ai.js
CHANGED
|
@@ -237,20 +237,26 @@ class Ai {
|
|
|
237
237
|
* @template {CustomEntityDetectionModel} T
|
|
238
238
|
* @param {string|WingbotModel|T} model - wingbot model name or AI plugin
|
|
239
239
|
* @param {string} prefix - model prefix
|
|
240
|
+
* @param {object} [options={}]
|
|
241
|
+
* @param {number} [options.cacheSize]
|
|
242
|
+
* @param {boolean} [options.verbose]
|
|
243
|
+
* @param {number} [options.cachePhrasesTime]
|
|
244
|
+
*
|
|
240
245
|
*
|
|
241
246
|
* @returns {T}
|
|
242
247
|
* @memberOf Ai
|
|
243
248
|
*/
|
|
244
|
-
register (model = null, prefix = this.DEFAULT_PREFIX) {
|
|
249
|
+
register (model = null, prefix = this.DEFAULT_PREFIX, options = {}) {
|
|
245
250
|
/** @type {T} */
|
|
246
251
|
let modelObj;
|
|
247
252
|
|
|
248
253
|
if (!model) {
|
|
249
254
|
// @ts-ignore
|
|
250
|
-
modelObj = new CustomEntityDetectionModel({ prefix });
|
|
255
|
+
modelObj = new CustomEntityDetectionModel({ ...options, prefix });
|
|
251
256
|
} else if (typeof model === 'string') {
|
|
252
257
|
// @ts-ignore
|
|
253
258
|
modelObj = new WingbotModel({
|
|
259
|
+
...options,
|
|
254
260
|
model,
|
|
255
261
|
prefix
|
|
256
262
|
}, this.logger);
|
|
@@ -37,6 +37,7 @@ class CachedModel extends CustomEntityDetectionModel {
|
|
|
37
37
|
* @param {object} options
|
|
38
38
|
* @param {string} [options.prefix]
|
|
39
39
|
* @param {number} [options.cacheSize]
|
|
40
|
+
* @param {boolean} [options.verbose]
|
|
40
41
|
* @param {number} [options.cachePhrasesTime]
|
|
41
42
|
* @param {{ warn: Function, error: Function, log: Function }} [log]
|
|
42
43
|
*/
|