@tiledesk/tiledesk-server 2.9.7 → 2.9.8
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/routes/kb.js +10 -3
package/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@
|
|
5
5
|
🚀 IN PRODUCTION 🚀
|
6
6
|
(https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
|
7
7
|
|
8
|
+
# 2.9.8
|
9
|
+
- Added model contexts fro kb preview
|
10
|
+
- Update tybot-connector to 0.2.93
|
11
|
+
|
8
12
|
# 2.9.7
|
9
13
|
- Fix bug: draft conversation was shown in monitor
|
10
14
|
- Update tybot-connector to 0.2.92
|
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.9.
|
4
|
+
"version": "2.9.8",
|
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.
|
51
|
+
"@tiledesk/tiledesk-tybot-connector": "^0.2.93",
|
52
52
|
"@tiledesk/tiledesk-whatsapp-connector": "^0.1.72",
|
53
53
|
"@tiledesk/tiledesk-whatsapp-jobworker": "^0.0.8",
|
54
54
|
"@tiledesk/tiledesk-sms-connector": "^0.1.7",
|
package/routes/kb.js
CHANGED
@@ -42,7 +42,14 @@ let default_preview_settings = {
|
|
42
42
|
}
|
43
43
|
|
44
44
|
//let default_context = "Answer if and ONLY if the answer is contained in the context provided. If the answer is not contained in the context provided ALWAYS answer with <NOANS>\n{context}"
|
45
|
-
let default_context = "You are an helpful assistant for question-answering tasks.\nUse ONLY the following pieces of retrieved context to answer the question.\nIf you don't know the answer, just say that you don't know.\nIf none of the retrieved context answer the question, add this word to the end <NOANS>\n\n{context}";
|
45
|
+
//let default_context = "You are an helpful assistant for question-answering tasks.\nUse ONLY the following pieces of retrieved context to answer the question.\nIf you don't know the answer, just say that you don't know.\nIf none of the retrieved context answer the question, add this word to the end <NOANS>\n\n{context}";
|
46
|
+
let contexts = {
|
47
|
+
"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}####",
|
48
|
+
"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}####",
|
49
|
+
"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}####",
|
50
|
+
"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}####",
|
51
|
+
"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}####"
|
52
|
+
}
|
46
53
|
|
47
54
|
/**
|
48
55
|
* ****************************************
|
@@ -219,9 +226,9 @@ router.post('/qa', async (req, res) => {
|
|
219
226
|
// Check if "Advanced Mode" is active. In such case the default_context must be not appended
|
220
227
|
if (!data.advanced_context) {
|
221
228
|
if (data.system_context) {
|
222
|
-
data.system_context = data.system_context + " \n" +
|
229
|
+
data.system_context = data.system_context + " \n" + contexts[data.model];
|
223
230
|
} else {
|
224
|
-
data.system_context =
|
231
|
+
data.system_context = contexts[data.model];
|
225
232
|
}
|
226
233
|
}
|
227
234
|
|