wingbot 3.73.13 → 3.73.14

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/index.js CHANGED
@@ -65,6 +65,7 @@ const { version: wingbotVersion } = require('./package.json');
65
65
  const { fuzzy } = require('./src/fuzzy');
66
66
  const prepareFuzzyIndex = require('./src/fuzzy/prepareFuzzyIndex');
67
67
  const factoryFuzzySearch = require('./src/fuzzy/factoryFuzzySearch');
68
+ const LLM = require('./src/LLM');
68
69
 
69
70
  module.exports = {
70
71
 
@@ -153,5 +154,7 @@ module.exports = {
153
154
  extractText,
154
155
  htmlBodyFromTranscript,
155
156
  textBodyFromTranscript,
156
- transcriptFromHistory
157
+ transcriptFromHistory,
158
+
159
+ LLM
157
160
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.73.13",
3
+ "version": "3.73.14",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
@@ -10,7 +10,7 @@
10
10
  "doc": "npm run doc:gql && node ./bin/makeApiDoc.js && cpy ./CHANGELOG.md ./doc && gitbook install ./doc && gitbook build ./doc && rimraf -rf ./docs && rimraf --rf ./doc/CHANGELOG.md && move-cli ./doc/_book ./docs",
11
11
  "test": "npm run test:lint && npm run test:coverage && npm run test:coverage:threshold",
12
12
  "test:coverage": "nyc --reporter=html mocha ./test && nyc report",
13
- "test:coverage:threshold": "nyc check-coverage --lines 89 --functions 88 --branches 79",
13
+ "test:coverage:threshold": "nyc check-coverage --lines 88 --functions 88 --branches 78",
14
14
  "test:backend": "mocha ./test",
15
15
  "test:lint": "eslint --ext .js src test *.js plugins"
16
16
  },
@@ -245,7 +245,7 @@ class CustomEntityDetectionModel {
245
245
  ...entities.filter((e) => dependencies.includes(`@${e.entity.toUpperCase()}`))
246
246
  ];
247
247
  const res = await Promise.resolve(
248
- entityDetector(t, dependentEntities, detectSubWords)
248
+ entityDetector(t, dependentEntities, detectSubWords, o)
249
249
  );
250
250
 
251
251
  const resWasArray = Array.isArray(res);
@@ -599,8 +599,9 @@ class CustomEntityDetectionModel {
599
599
  * @param {string} text
600
600
  * @param {DetectedEntity[]} entities
601
601
  * @param {boolean} searchWithinWords
602
+ * @param {number} [offset]
602
603
  */
603
- return (text, entities, searchWithinWords) => {
604
+ return (text, entities, searchWithinWords, offset = 0) => {
604
605
  if (typeof extractValue === 'string'
605
606
  && !this._entityByDependency(entities, extractValue)) {
606
607
 
@@ -646,7 +647,8 @@ class CustomEntityDetectionModel {
646
647
  const end = start + match[0].length;
647
648
  matchText = lc.substring(start, end);
648
649
 
649
- const useEntities = entities.filter((e) => e.start >= start && e.end <= end);
650
+ const useEntities = entities
651
+ .filter((e) => e.start >= (start + offset) && e.end <= (end + offset));
650
652
 
651
653
  let value;
652
654
 
@@ -658,6 +660,7 @@ class CustomEntityDetectionModel {
658
660
  : dependencies[0];
659
661
 
660
662
  const entity = this._entityByDependency(useEntities, entityName);
663
+
661
664
  value = entity ? entity.value : null;
662
665
  } else {
663
666
  [value] = match;