@tiledesk/tiledesk-server 2.10.84 → 2.10.86

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
@@ -5,6 +5,9 @@
5
5
  🚀 IN PRODUCTION 🚀
6
6
  (https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
7
7
 
8
+ # 2.10.85
9
+ - Updated: default system context for gpt-4.1 models
10
+
8
11
  # 2.10.84
9
12
  - Added: missing default contexts for gpt-4.1 models
10
13
  - Updated tybot-connector to 2.0.10
@@ -8,8 +8,8 @@ var winston = require('../config/winston');
8
8
  async function up () {
9
9
  await new Promise((resolve, reject) => {
10
10
 
11
- // { $exists: true } to fix: The positional operator did not find the match needed from the query.
12
- Label.updateMany({$where: "this.data.length == 1","data": { $exists: true } }, {"$set": {"data.$.default": true}}, function (err, updates) {
11
+ // { $exists: true } to fix: The positional operator did not find the match needed from the query.
12
+ Label.updateMany({ data: { $exists: true }, "data.1": { $exists: false } }, {"$set": {"data.$.default": true}}, function (err, updates) {
13
13
  if (err) {
14
14
  winston.error("Schema migration: label err1", err);
15
15
  }
@@ -19,19 +19,19 @@ async function up () {
19
19
  // {"data": { $elemMatch: {"lang": { $ne: "EN" }}}}
20
20
  // Label.updateMany({$where: "this.data.length > 1", 'data.lang': {$ne: "EN"}} , {"$set": {"data.$[].default": false}}, function (err, updates) {
21
21
  // Label.updateMany({$where: "this.data.length > 1", 'data.lang': {$nin: ["EN"]}} , {"$set": {"data.$[].default": false}}, function (err, updates) {
22
- Label.updateMany({$where: "this.data.length > 1", "data": { $elemMatch: {"lang": { $ne: "EN" }}}} , {"$set": {"data.$[].default": false}}, function (err, updates) {
23
- if (err) {
24
- winston.error("Schema migration: label err2", err);
25
- }
26
- winston.info("Schema updated for " + updates.nModified + " label to default false field")
22
+ Label.updateMany({ data: { $elemMatch: { "lang": { $ne: "EN" } } }, "data.1": { $exists: true } } , {"$set": {"data.$[].default": false}}, function (err, updates) {
23
+ if (err) {
24
+ winston.error("Schema migration: label err2", err);
25
+ }
26
+ winston.info("Schema updated for " + updates.nModified + " label to default false field")
27
27
 
28
- Label.updateMany({$where: "this.data.length > 1", "data.lang": "EN"}, {"$set": {"data.$.default": true}}, function (err, updates) {
29
- if (err) {
30
- winston.error("Schema migration: label err3", err);
31
- }
32
- winston.info("Schema updated for " + updates.nModified + " label with multiple data to default field")
33
- return resolve('ok');
34
- });
28
+ Label.updateMany({"data.lang": "EN", "data.1": { $exists: true } }, {"$set": {"data.$.default": true}}, function (err, updates) {
29
+ if (err) {
30
+ winston.error("Schema migration: label err3", err);
31
+ }
32
+ winston.info("Schema updated for " + updates.nModified + " label with multiple data to default field")
33
+ return resolve('ok');
34
+ });
35
35
 
36
36
  // return resolve('ok');
37
37
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-server",
3
3
  "description": "The Tiledesk server module",
4
- "version": "2.10.84",
4
+ "version": "2.10.86",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -47,12 +47,12 @@
47
47
  "@tiledesk/tiledesk-messenger-connector": "^0.1.23",
48
48
  "@tiledesk/tiledesk-rasa-connector": "^1.0.10",
49
49
  "@tiledesk/tiledesk-telegram-connector": "^0.1.14",
50
- "@tiledesk/tiledesk-tybot-connector": "^2.0.10",
50
+ "@tiledesk/tiledesk-tybot-connector": "^2.0.11",
51
51
  "@tiledesk/tiledesk-whatsapp-connector": "^0.1.83",
52
52
  "@tiledesk/tiledesk-whatsapp-jobworker": "^0.0.12",
53
53
  "@tiledesk/tiledesk-sms-connector": "^0.1.11",
54
54
  "@tiledesk/tiledesk-vxml-connector": "^0.1.76",
55
- "@tiledesk/tiledesk-voice-twilio-connector": "^0.1.12",
55
+ "@tiledesk/tiledesk-voice-twilio-connector": "^0.1.16",
56
56
  "@tiledesk/tiledesk-multi-worker": "^0.1.20",
57
57
  "passport-oauth2": "^1.8.0",
58
58
  "amqplib": "^0.5.5",
@@ -31,6 +31,11 @@ class Listener {
31
31
  brand_name = process.env.BRAND_NAME
32
32
  }
33
33
 
34
+ let openai_endpoint = process.env.OPENAI_ENDPOINT;
35
+ winston.debug("OpenAI Endpoint: ", openai_endpoint);
36
+
37
+ let gpt_key = process.env.GPTKEY;
38
+
34
39
  let log = process.env.VOICE_TWILIO_LOG || false
35
40
  winston.debug("Voice log: "+ log);
36
41
 
@@ -42,6 +47,8 @@ class Listener {
42
47
  REDIS_PORT: port,
43
48
  REDIS_PASSWORD: password,
44
49
  BRAND_NAME: brand_name,
50
+ OPENAI_ENDPOINT: openai_endpoint,
51
+ GPT_KEY: gpt_key,
45
52
  log: log
46
53
  }, (err) => {
47
54
  if (!err) {
package/routes/kb.js CHANGED
@@ -75,9 +75,9 @@ let contexts = {
75
75
  "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}####",
76
76
  "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==",
77
77
  "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==",
78
- "gpt-4.1": "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-4.1-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==",
80
- "gpt-4.1-nano": "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=="
78
+ "gpt-4.1": "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, append <NOANS> at the end of the answer\n\n==Retrieved context start==\n{context}\n==Retrieved context end==",
79
+ "gpt-4.1-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, append <NOANS> at the end of the answer\n\n==Retrieved context start==\n{context}\n==Retrieved context end==",
80
+ "gpt-4.1-nano": "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, append <NOANS> at the end of the answer\n\n==Retrieved context start==\n{context}\n==Retrieved context end=="
81
81
  }
82
82
 
83
83
  /**