@tiledesk/tiledesk-tybot-connector 2.0.10-rc16 → 2.0.10-rc18
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/logs/app2.log +1882 -0
- package/package.json +1 -1
- package/tiledeskChatbotPlugs/directives/DirAskGPTV2.js +4 -1
- package/tiledeskChatbotPlugs/directives/DirCaptureUserReply.js +5 -1
- package/tiledeskChatbotPlugs/directives/DirReply.js +5 -2
- package/tiledeskChatbotPlugs/directives/DirReplyV2.js +2 -2
package/package.json
CHANGED
|
@@ -86,7 +86,10 @@ class DirAskGPTV2 {
|
|
|
86
86
|
"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}####",
|
|
87
87
|
"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}####",
|
|
88
88
|
"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==",
|
|
89
|
-
"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=="
|
|
89
|
+
"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==",
|
|
90
|
+
"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==",
|
|
91
|
+
"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==",
|
|
92
|
+
"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=="
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
let source = null;
|
|
@@ -35,7 +35,6 @@ class DirCaptureUserReply {
|
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
this.go(action, () => {
|
|
38
|
-
this.logger.info("[Capture User Reply] Action completed");
|
|
39
38
|
callback();
|
|
40
39
|
});
|
|
41
40
|
}
|
|
@@ -49,6 +48,7 @@ class DirCaptureUserReply {
|
|
|
49
48
|
const actionId = action["_tdActionId"];;
|
|
50
49
|
await this.chatbot.lockIntent(this.requestId, intent_name);
|
|
51
50
|
await this.chatbot.lockAction(this.requestId, actionId);
|
|
51
|
+
this.logger.info("[Capture User Reply] Waiting for user reply...");
|
|
52
52
|
callback();
|
|
53
53
|
return;
|
|
54
54
|
} else {
|
|
@@ -63,6 +63,7 @@ class DirCaptureUserReply {
|
|
|
63
63
|
}
|
|
64
64
|
try {
|
|
65
65
|
const user_reply = this.message.text;
|
|
66
|
+
this.logger.info("[Capture User Reply] User replied with: ", user_reply);
|
|
66
67
|
if (this.context.tdcache) {
|
|
67
68
|
if (action.assignResultTo) {
|
|
68
69
|
winston.debug("(DirCaptureUserReply) assign assignResultTo: " + action.assignResultTo);
|
|
@@ -73,16 +74,19 @@ class DirCaptureUserReply {
|
|
|
73
74
|
if (callback) {
|
|
74
75
|
if (goToIntent) {
|
|
75
76
|
this.#executeGoTo(goToIntent, () => {
|
|
77
|
+
this.logger.info("[Capture User Reply] Action completed");
|
|
76
78
|
callback(); // continue the flow
|
|
77
79
|
});
|
|
78
80
|
}
|
|
79
81
|
else {
|
|
82
|
+
this.logger.info("[Capture User Reply] Action completed");
|
|
80
83
|
callback(); // continue the flow
|
|
81
84
|
}
|
|
82
85
|
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
catch(error) {
|
|
89
|
+
this.logger.error("[Capture User Reply] Error: ", error);
|
|
86
90
|
winston.error("(DirCaptureUserReply) error: ", error);
|
|
87
91
|
}
|
|
88
92
|
}
|
|
@@ -25,6 +25,7 @@ class DirReply {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
execute(directive, callback) {
|
|
28
|
+
this.logger.info("[Reply] Executing action");
|
|
28
29
|
let action;
|
|
29
30
|
if (directive.action) {
|
|
30
31
|
action = directive.action;
|
|
@@ -34,14 +35,14 @@ class DirReply {
|
|
|
34
35
|
action.attributes.fillParams = true;
|
|
35
36
|
}
|
|
36
37
|
else {
|
|
38
|
+
this.logger.error("Incorrect action for ", directive.name, directive)
|
|
37
39
|
winston.error("DirReply Incorrect directive (no action provided):", directive);
|
|
38
40
|
callback();
|
|
39
41
|
return;
|
|
40
42
|
}
|
|
41
|
-
this.logger.info("Executing Action Reply ", directive.action)
|
|
42
43
|
|
|
43
44
|
this.go(action, () => {
|
|
44
|
-
this.logger.info("Action
|
|
45
|
+
this.logger.info("[Reply] Action completed");
|
|
45
46
|
callback();
|
|
46
47
|
});
|
|
47
48
|
}
|
|
@@ -62,6 +63,7 @@ class DirReply {
|
|
|
62
63
|
const filler = new Filler();
|
|
63
64
|
// fill text attribute
|
|
64
65
|
message.text = filler.fill(message.text, requestAttributes);
|
|
66
|
+
this.logger.debug("[Reply] Reply with: " + message.text);
|
|
65
67
|
|
|
66
68
|
if (message.metadata) {
|
|
67
69
|
winston.debug("DirReply filling message 'metadata':", message.metadata);
|
|
@@ -148,6 +150,7 @@ class DirReply {
|
|
|
148
150
|
(err) => {
|
|
149
151
|
if (err) {
|
|
150
152
|
winston.error("DirReply Error sending reply: ", err);
|
|
153
|
+
this.logger.error("[Reply] Error sending reply: " + err);
|
|
151
154
|
}
|
|
152
155
|
winston.verbose("DirReply reply message sent")
|
|
153
156
|
const delay = TiledeskChatbotUtil.totalMessageWait(cleanMessage);
|
|
@@ -32,7 +32,7 @@ class DirReplyV2 {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
execute(directive, callback) {
|
|
35
|
-
this.logger.info("[Reply] Executing action");
|
|
35
|
+
this.logger.info("[Advanced Reply] Executing action");
|
|
36
36
|
winston.verbose("Execute ReplyV2 directive");
|
|
37
37
|
let action;
|
|
38
38
|
if (directive.action) {
|
|
@@ -49,7 +49,7 @@ class DirReplyV2 {
|
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
this.go(action, (stop) => {
|
|
52
|
-
this.logger.info("[Reply] Action completed");
|
|
52
|
+
this.logger.info("[Advanced Reply] Action completed");
|
|
53
53
|
callback(stop);
|
|
54
54
|
});
|
|
55
55
|
}
|