wingbot 3.65.1 → 3.65.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.65.1",
3
+ "version": "3.65.3",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -48,7 +48,7 @@ function chatgptPlugin (params, configuration = {}) {
48
48
  const persona = compileWithState(req, res, params.persona).trim();
49
49
 
50
50
  const continueConfig = params.continueConfig || [];
51
- const lang = `${res.newState.lang || req.state.lang || 'default'}`.trim().toLocaleLowerCase();
51
+ const lang = `${res.newState.lang || req.state.lang || 'default'}`.trim().toLowerCase();
52
52
  const continueReply = continueConfig.find((c) => `${c.lang}`.trim().toLowerCase() === lang)
53
53
  || continueConfig.find((c) => ['default', '']
54
54
  .includes(`${c.lang || ''}`.trim().toLowerCase()));
@@ -129,7 +129,7 @@ function chatgptPlugin (params, configuration = {}) {
129
129
  .filter((ch) => ch.message && ch.message.role === 'assistant' && ch.message.content)
130
130
  .map((ch) => {
131
131
 
132
- let sliced = false;
132
+ let sliced = data.usage && data.usage.completion_tokens >= maxTokens;
133
133
 
134
134
  let filtered = ch.message.content
135
135
  .replace(/\n\n/g, '\n')
package/src/Responder.js CHANGED
@@ -779,7 +779,17 @@ class Responder {
779
779
  e.match
780
780
  .forEach((rule) => {
781
781
  if (rule.startsWith('#')) {
782
- // @todo propagate also keywords
782
+ if (!rule.match(/^#(\|?[a-z0-9-]+)+$/i)) {
783
+ return;
784
+ }
785
+ const keywords = rule.match(/\|?[a-z0-9-]+/ig)
786
+ .map((k) => k
787
+ .replace(/\|/g, '')
788
+ .replace(/[-\s]+/g, ' '));
789
+
790
+ expectedIntentsAndEntities.push(
791
+ ...keywords
792
+ );
783
793
  return;
784
794
  }
785
795
  if (rule.startsWith('@')) {