@tiledesk/tiledesk-tybot-connector 0.2.151 → 0.2.153-rc1
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/CHANGELOG.md +5 -10
- package/index.js +5 -3
- package/models/TiledeskChatbot.js +4 -19
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,17 +5,12 @@
|
|
|
5
5
|
available on:
|
|
6
6
|
▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- Added possibility to select namespace by name
|
|
11
|
-
- Added filler to namespace in DirAskGPTv2
|
|
12
|
-
- Added filler to command.settings in DirReply
|
|
8
|
+
# v0.2.153-rc1
|
|
9
|
+
- changed: context for gpt-40 and gpt-40-mini
|
|
13
10
|
|
|
14
|
-
# v0.2.
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
- Added flowError on JSONCondition when result = null
|
|
18
|
-
- Added fix on Filler -->
|
|
11
|
+
# v0.2.152
|
|
12
|
+
- Restored old default context for AskKB Action
|
|
13
|
+
- Deleted message "Intent not found".
|
|
19
14
|
|
|
20
15
|
# v0.2.151
|
|
21
16
|
- bug-fixed: context for gpt-40 and gpt-40-mini
|
package/index.js
CHANGED
|
@@ -196,11 +196,13 @@ router.post('/ext/:botid', async (req, res) => {
|
|
|
196
196
|
}
|
|
197
197
|
catch(err) {
|
|
198
198
|
console.error("(tybotRoute) An error occurred replying to message:", JSON.stringify(message), "\nError:", err );
|
|
199
|
+
callback();
|
|
200
|
+
return;
|
|
199
201
|
}
|
|
200
202
|
if (!reply) {
|
|
201
|
-
reply
|
|
202
|
-
|
|
203
|
-
|
|
203
|
+
if (log) { console.log("(tybotRoute) No reply. Stop flow.") }
|
|
204
|
+
callback();
|
|
205
|
+
return;
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
// console.log("reply is:", reply);
|
|
@@ -203,9 +203,7 @@ class TiledeskChatbot {
|
|
|
203
203
|
let reply;
|
|
204
204
|
if (!intent || (intent && !intent.name)) {
|
|
205
205
|
if (this.log) {console.log("Invalid intent:", explicit_intent_name);}
|
|
206
|
-
|
|
207
|
-
"text": "Invalid intent: *" + explicit_intent_name + "*"
|
|
208
|
-
}
|
|
206
|
+
resolve();
|
|
209
207
|
}
|
|
210
208
|
else {
|
|
211
209
|
if (this.log) {console.log("processing intent:", explicit_intent_name);}
|
|
@@ -233,21 +231,12 @@ class TiledeskChatbot {
|
|
|
233
231
|
}
|
|
234
232
|
for (const [key, value] of Object.entries(intent.parameters)) {
|
|
235
233
|
if (this.log) {console.log(`Adding attribute from intent invocation /intentName{} => ${key}: ${value}`);}
|
|
236
|
-
// const parameter_typeof_key = "_tdTypeOf:" + key;
|
|
237
|
-
// console.log("intent[parameter_typeof_key]",parameter_typeof_key, intent.parameters[parameter_typeof_key]);
|
|
238
|
-
// if (intent.parameters[parameter_typeof_key] === "object") {
|
|
239
|
-
// const parameter_value_string = JSON.stringify(value)
|
|
240
|
-
// console.log("Adding parameter as string:", parameter_value_string)
|
|
241
234
|
this.addParameter(key, value);
|
|
242
|
-
//this.addParameter(parameter_typeof_key, intent[parameter_typeof_key]);
|
|
243
|
-
// }
|
|
244
|
-
// else { // TODO: support the other data types
|
|
245
|
-
// this.addParameter(key, value);
|
|
246
|
-
// }
|
|
247
|
-
|
|
248
235
|
}
|
|
249
236
|
}
|
|
250
237
|
reply = await this.execIntent(faq, message, lead);
|
|
238
|
+
resolve(reply);
|
|
239
|
+
return;
|
|
251
240
|
}
|
|
252
241
|
catch(error) {
|
|
253
242
|
console.error("error");
|
|
@@ -256,13 +245,9 @@ class TiledeskChatbot {
|
|
|
256
245
|
}
|
|
257
246
|
else {
|
|
258
247
|
if (this.log) {console.log("Intent not found:", explicit_intent_name);}
|
|
259
|
-
|
|
260
|
-
"text": "Intent not found: " + explicit_intent_name
|
|
261
|
-
}
|
|
248
|
+
resolve()
|
|
262
249
|
}
|
|
263
250
|
}
|
|
264
|
-
resolve(reply);
|
|
265
|
-
return;
|
|
266
251
|
}
|
|
267
252
|
|
|
268
253
|
// SEARCH INTENTS
|