wingbot 3.67.3 → 3.67.5
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/ChatGpt.js
CHANGED
|
@@ -10,25 +10,27 @@ const DEFAULT_PHRASES_CACHE_TIME = 3600000; // one hour
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @typedef {object} Entity
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
15
|
-
* @
|
|
13
|
+
* @prop {string} entity
|
|
14
|
+
* @prop {string} value
|
|
15
|
+
* @prop {number} score
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* @typedef {object} Intent
|
|
20
|
-
* @
|
|
21
|
-
* @
|
|
22
|
-
* @
|
|
20
|
+
* @prop {string} intent
|
|
21
|
+
* @prop {number} score
|
|
22
|
+
* @prop {Entity[]} [entities]
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* @typedef {object} Result
|
|
27
|
-
* @
|
|
28
|
-
* @
|
|
27
|
+
* @prop {string} [text]
|
|
28
|
+
* @prop {Entity[]} entities
|
|
29
|
+
* @prop {Intent[]} intents
|
|
29
30
|
*/
|
|
30
31
|
|
|
31
32
|
/** @typedef {import('../Request')} Request */
|
|
33
|
+
|
|
32
34
|
class CachedModel extends CustomEntityDetectionModel {
|
|
33
35
|
|
|
34
36
|
/**
|
|
@@ -47,7 +47,7 @@ const { iterateThroughWords } = require('../utils/ai');
|
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* @typedef {object} Result
|
|
50
|
-
* @prop {string} text
|
|
50
|
+
* @prop {string} [text]
|
|
51
51
|
* @prop {Entity[]} entities
|
|
52
52
|
* @prop {Intent[]} intents
|
|
53
53
|
*/
|
|
@@ -416,7 +416,10 @@ class CustomEntityDetectionModel {
|
|
|
416
416
|
list = [];
|
|
417
417
|
byEntity.set(entity.entity, list);
|
|
418
418
|
}
|
|
419
|
-
list.push(
|
|
419
|
+
list.push({
|
|
420
|
+
text: s,
|
|
421
|
+
...entity
|
|
422
|
+
});
|
|
420
423
|
}
|
|
421
424
|
|
|
422
425
|
const normalized = Array.from(byEntity.entries())
|