@tiledesk/tiledesk-tybot-connector 0.2.151 → 0.2.152

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 CHANGED
@@ -17,6 +17,10 @@ available on:
17
17
  - Added flowError on JSONCondition when result = null
18
18
  - Added fix on Filler -->
19
19
 
20
+ # v0.2.152
21
+ - Restored old default context for AskKB Action
22
+ - Deleted message "Intent not found".
23
+
20
24
  # v0.2.151
21
25
  - bug-fixed: context for gpt-40 and gpt-40-mini
22
26
 
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
- "text": "No messages found. Is 'defaultFallback' intent missing?"
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
- reply = {
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
- reply = {
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "0.2.151",
3
+ "version": "0.2.152",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -76,8 +76,8 @@ class DirAskGPTV2 {
76
76
  "gpt-3.5-turbo": "You are an helpful assistant for question-answering tasks.\nUse ONLY the pieces of retrieved context delimited by #### to answer the question.\nIf you don't know the answer, just say: \"I don't know<NOANS>\"\n\n####{context}####",
77
77
  "gpt-4": "You are an helpful assistant for question-answering tasks.\nUse ONLY the pieces of retrieved context delimited by #### to answer the question.\nIf you don't know the answer, just say that you don't know.\nIf and only if none of the retrieved context is useful for your task, add this word to the end <NOANS>\n\n####{context}####",
78
78
  "gpt-4-turbo-preview": "You are an helpful assistant for question-answering tasks.\nUse ONLY the pieces of retrieved context delimited by #### to answer the question.\nIf you don't know the answer, just say that you don't know.\nIf and only if none of the retrieved context is useful for your task, add this word to the end <NOANS>\n\n####{context}####",
79
- "gpt-4o": "You are an helpful assistant for question-answering tasks. Follow these steps carefully:\n1. Answer in the same language of the user question, regardless of the retrieved context language\n2. Use ONLY the pieces of the retrieved context to answer the question.\n3. If the retrieved context does not contain sufficient information to generate an accurate and informative answer, return <NOANS>\n\n==Retrieved context start==\n{context}\n==Retrieved context end==",
80
- "gpt-4o-mini": "You are an helpful assistant for question-answering tasks. Follow these steps carefully:\n1. Answer in the same language of the user question, regardless of the retrieved context language\n2. Use ONLY the pieces of the retrieved context to answer the question.\n3. If the retrieved context does not contain sufficient information to generate an accurate and informative answer, return <NOANS>\n\n==Retrieved context start==\n{context}\n==Retrieved context end=="
79
+ "gpt-4o": "You are an helpful assistant for question-answering tasks.\nUse ONLY the pieces of retrieved context delimited by #### to answer the question.\nIf you don't know the answer, just say that you don't know.\nIf the context does not contain sufficient information to generate an accurate and informative answer, return <NOANS>\n\n####{context}####",
80
+ "gpt-4o-mini": "You are an helpful assistant for question-answering tasks.\nUse ONLY the pieces of retrieved context delimited by #### to answer the question.\nIf you don't know the answer, just say that you don't know.\nIf the context does not contain sufficient information to generate an accurate and informative answer, return <NOANS>\n\n####{context}####"
81
81
  }
82
82
 
83
83
  let source = null;