@tiledesk/tiledesk-server 2.8.1 → 2.8.4

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@
5
5
  🚀 IN PRODUCTION 🚀
6
6
  (https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
7
7
 
8
+ # 2.8.4
9
+ - Updated tybot-connector to 0.2.83
10
+
11
+ # 2.8.3
12
+ - Added advanced_context support
13
+ - Updated default preview settings
14
+
15
+ # 2.8.2
16
+ - Updated default preview settings
17
+ - Added scrape_type in /scrape/single for fix indexing on retrain
18
+
8
19
  # 2.8.1
9
20
  - Added trashed=false in chatbot namespace query
10
21
  - Return empty array if no chatbots are using the namespace
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.8.1",
4
+ "version": "2.8.4",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -48,7 +48,7 @@
48
48
  "@tiledesk/tiledesk-rasa-connector": "^1.0.10",
49
49
  "@tiledesk/tiledesk-telegram-connector": "^0.1.14",
50
50
  "@tiledesk/tiledesk-train-jobworker": "^0.0.11",
51
- "@tiledesk/tiledesk-tybot-connector": "^0.2.82",
51
+ "@tiledesk/tiledesk-tybot-connector": "^0.2.83",
52
52
  "@tiledesk/tiledesk-whatsapp-connector": "^0.1.72",
53
53
  "@tiledesk/tiledesk-whatsapp-jobworker": "^0.0.8",
54
54
  "amqplib": "^0.5.5",
package/routes/kb.js CHANGED
@@ -32,8 +32,8 @@ jobManager.connectAndStartPublisher(() => {
32
32
  })
33
33
 
34
34
  let default_preview_settings = {
35
- model: 'gpt-3.5-turbo',
36
- max_tokens: 128,
35
+ model: 'gpt-4o',
36
+ max_tokens: 256,
37
37
  temperature: 0.7,
38
38
  top_k: 4,
39
39
  //context: "You are an awesome AI Assistant."
@@ -54,6 +54,10 @@ router.post('/scrape/single', async (req, res) => {
54
54
  let data = req.body;
55
55
  winston.debug("/scrape/single data: ", data);
56
56
 
57
+ if (!data.scrape_type) {
58
+ data.scrape_type = 1;
59
+ }
60
+
57
61
  let namespaces = await Namespace.find({ id_project: project_id }).catch((err) => {
58
62
  winston.error("find namespaces error: ", err)
59
63
  res.status(500).send({ success: false, error: err })
@@ -94,6 +98,11 @@ router.post('/scrape/single', async (req, res) => {
94
98
  json.content = kb.content;
95
99
  }
96
100
 
101
+ json.scrape_type = 1;
102
+ if (data.scrape_type) {
103
+ json.scrape_type = data.scrape_type;
104
+ }
105
+
97
106
  startScrape(json).then((response) => {
98
107
  winston.verbose("startScrape response: ", response);
99
108
  res.status(200).send(response);
@@ -204,8 +213,12 @@ router.post('/qa', async (req, res) => {
204
213
  }
205
214
 
206
215
  // Check if "Advanced Mode" is active. In such case the default_context must be not appended
207
- if (data.system_context) {
208
- data.system_context = data.system_context + " \n" + default_context;
216
+ if (!data.advanced_context) {
217
+ if (data.system_context) {
218
+ data.system_context = data.system_context + " \n" + default_context;
219
+ } else {
220
+ data.system_context = default_context;
221
+ }
209
222
  }
210
223
 
211
224
  openaiService.askNamespace(data).then((resp) => {