@tiledesk/tiledesk-tybot-connector 0.2.96-rc1 → 0.2.96
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 +15 -7
- package/package.json +1 -1
- package/tiledeskChatbotPlugs/directives/DirAskGPTV2.js +7 -4
- package/tiledeskChatbotPlugs/directives/DirDepartment.js +1 -1
- package/tiledeskChatbotPlugs/directives/DirGptTask.js +0 -6
- package/tiledeskChatbotPlugs/directives/DirIfOnlineAgentsV2.js +1 -0
- package/tiledeskChatbotPlugs/directives/DirIfOpenHours.js +0 -2
- package/tiledeskChatbotPlugs/directives/DirReply.js +6 -0
- package/tiledeskChatbotPlugs/directives/DirSetAttributeV2.js +4 -4
- package/tiledeskChatbotPlugs/directives/Directives.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,19 +5,30 @@
|
|
|
5
5
|
available on:
|
|
6
6
|
▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- Added
|
|
8
|
+
<!-- // CHECK IT!!!
|
|
9
|
+
# v0.2.98
|
|
10
|
+
- Added possibility to select namespace by name
|
|
11
|
+
- Added filler to namespace in DirAskGPTv2
|
|
12
|
+
- Added filler to command.settings in DirReply
|
|
11
13
|
|
|
12
14
|
# v0.2.97
|
|
13
15
|
- Added a limit in upload and download for WebRequestV2: maxContentLength: 10000000, // max 10mb response size, maxBodyLength: 10000000 // max 10mb request body size
|
|
14
16
|
- Added jsonCondition test on json objects properties
|
|
15
17
|
- Added flowError on JSONCondition when result = null
|
|
16
|
-
- Added fix on Filler
|
|
18
|
+
- Added fix on Filler -->
|
|
17
19
|
|
|
18
20
|
# v0.2.96
|
|
19
21
|
- Added timestamp (number) and now (Date Object) attributes
|
|
20
22
|
|
|
23
|
+
- Added a limit in upload and download for WebRequestV2: maxContentLength: 10000000, // max 10mb response size, maxBodyLength: 10000000 // max 10mb request body size
|
|
24
|
+
- Added jsonCondition test on json objects properties
|
|
25
|
+
- Added flowError on JSONCondition when result = null
|
|
26
|
+
- Added fix on Filler
|
|
27
|
+
|
|
28
|
+
- Added possibility to select namespace by name
|
|
29
|
+
- Added filler to namespace in DirAskGPTv2
|
|
30
|
+
- Added filler to command.settings in DirReply
|
|
31
|
+
|
|
21
32
|
# v0.2.95
|
|
22
33
|
- If Online Agents V2 - bug fix (If Project Available Agents V2 -> MWeb)
|
|
23
34
|
|
|
@@ -162,9 +173,6 @@ available on:
|
|
|
162
173
|
- added flow attribute "decodedCustomJWT"
|
|
163
174
|
|
|
164
175
|
# v0.2.57
|
|
165
|
-
- Changed env variables for AskGPT actions
|
|
166
|
-
- Added support for temperature, top_k, max_tokens and context for AskGPTV2 action
|
|
167
|
-
- Added support for context with variables for GptTask action
|
|
168
176
|
- fixed catching reply error in index.js: reply = await chatbot.replyToMessage(message);
|
|
169
177
|
- Added context and top_k parameter in DirAskGPTV2
|
|
170
178
|
|
package/package.json
CHANGED
|
@@ -172,7 +172,11 @@ class DirAskGPTV2 {
|
|
|
172
172
|
|
|
173
173
|
|
|
174
174
|
if (action.namespaceAsName) {
|
|
175
|
-
|
|
175
|
+
// Namespace could be an attribute
|
|
176
|
+
const filled_namespace = filler.fill(action.namespace, requestVariables)
|
|
177
|
+
|
|
178
|
+
// namespace = await this.getNamespaceIdFromName(server_base_url, action.namespace)
|
|
179
|
+
namespace = await this.getNamespaceIdFromName(server_base_url, filled_namespace);
|
|
176
180
|
if (this.log) { console.log("DirAskGPT - Retrieved namespace id from name ", namespace); }
|
|
177
181
|
}
|
|
178
182
|
|
|
@@ -572,7 +576,7 @@ class DirAskGPTV2 {
|
|
|
572
576
|
},
|
|
573
577
|
method: "GET"
|
|
574
578
|
}
|
|
575
|
-
if (this.log) { console.log("DirAskGPT
|
|
579
|
+
if (this.log) { console.log("DirAskGPT get all namespaces HTTPREQUEST", HTTPREQUEST); }
|
|
576
580
|
|
|
577
581
|
this.#myrequest(
|
|
578
582
|
HTTPREQUEST, async (err, namespaces) => {
|
|
@@ -580,8 +584,7 @@ class DirAskGPTV2 {
|
|
|
580
584
|
console.error("(httprequest) DirAskGPT get all namespaces err: ", err);
|
|
581
585
|
resolve(null)
|
|
582
586
|
} else {
|
|
583
|
-
if (this.log) { console.log("(httprequest) DirAskGPT
|
|
584
|
-
console.log("(httprequest) DirAskGPT Increment token quote resbody: ", namespaces);
|
|
587
|
+
if (this.log) { console.log("(httprequest) DirAskGPT get all namespaces resbody: ", namespaces); }
|
|
585
588
|
|
|
586
589
|
let namespace = namespaces.find(n => n.name === name);
|
|
587
590
|
let namespace_id = namespace.id;
|
|
@@ -168,12 +168,6 @@ class DirGptTask {
|
|
|
168
168
|
json.messages.push(message);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
if (action.format_type) {
|
|
172
|
-
json.response_format = {
|
|
173
|
-
type: action.format_type
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
171
|
if (transcript) {
|
|
178
172
|
transcript.forEach(msg => {
|
|
179
173
|
if (!msg.content.startsWith('/')) {
|
|
@@ -110,6 +110,7 @@ class DirIfOnlineAgentsV2 {
|
|
|
110
110
|
if (this.log) {console.log("(DirIfOnlineAgents) selectedOption === all | getProjectAvailableAgents(null, true)"); }
|
|
111
111
|
agents = await this.getProjectAvailableAgents(null, true);
|
|
112
112
|
if (this.log) {console.log("(DirIfOnlineAgents) agents:", agents); }
|
|
113
|
+
console.log("(DirIfOnlineAgents) agents:", agents);
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
if (agents && agents.length > 0) {
|
|
@@ -216,7 +216,6 @@ class DirIfOpenHours {
|
|
|
216
216
|
}
|
|
217
217
|
axios(axios_options)
|
|
218
218
|
.then((res) => {
|
|
219
|
-
console.log("siamo quiii")
|
|
220
219
|
if (this.log) {
|
|
221
220
|
console.log("Response for url:", options.url);
|
|
222
221
|
console.log("Response headers:\n", JSON.stringify(res.headers));
|
|
@@ -233,7 +232,6 @@ class DirIfOpenHours {
|
|
|
233
232
|
}
|
|
234
233
|
})
|
|
235
234
|
.catch((error) => {
|
|
236
|
-
console.log("siamo quiii")
|
|
237
235
|
// console.error("An error occurred:", JSON.stringify(error.data));
|
|
238
236
|
if (callback) {
|
|
239
237
|
callback(error, null);
|
|
@@ -77,6 +77,12 @@ class DirReply {
|
|
|
77
77
|
TiledeskChatbotUtil.fillCommandAttachments(command, requestAttributes, this.log);
|
|
78
78
|
if (this.log) {console.log("command filled:", command.message.text);}
|
|
79
79
|
}
|
|
80
|
+
if (command.type === 'settings' && command.settings) {
|
|
81
|
+
Object.keys(command.settings).forEach(k => {
|
|
82
|
+
command.settings[k] = filler.fill(command.settings[k], requestAttributes)
|
|
83
|
+
if (this.log) {console.log("settings command filled:", command.settings[k]);}
|
|
84
|
+
})
|
|
85
|
+
}
|
|
80
86
|
}
|
|
81
87
|
}
|
|
82
88
|
}
|
|
@@ -105,16 +105,16 @@ class DirSetAttributeV2 {
|
|
|
105
105
|
if (this.log) {console.log("(SetAttributeV2) filling in setattribute...");}
|
|
106
106
|
await this.fillValues(action.operation.operands);
|
|
107
107
|
}
|
|
108
|
-
console.log("action.operation.operands.length", action.operation.operands.length);
|
|
109
|
-
console.log("action.operation.operands[0].type", action.operation.operands[0].type);
|
|
108
|
+
if (this.log) { console.log("action.operation.operands.length", action.operation.operands.length); }
|
|
109
|
+
if (this.log) { console.log("action.operation.operands[0].type", action.operation.operands[0].type); }
|
|
110
110
|
|
|
111
111
|
// FUN FACT: THIS TOOK A LOT OF EFFERT BUT IT WAS NEVER USED. YOU CAN SIMPLY CREATE A JSON ATTRIBUTE APPLYING
|
|
112
112
|
// JSONparse FUNCTION TO AN ATTRIBUTE.
|
|
113
113
|
if (action.operation.operands && action.operation.operands.length === 1 && action.operation.operands[0].type === "json") {
|
|
114
114
|
if (this.log) {console.log("(SetAttributeV2) setting json value...");}
|
|
115
|
-
console.log("(SetAttributeV2) setting json value... destination:", action.destination);
|
|
115
|
+
if (this.log) { console.log("(SetAttributeV2) setting json value... destination:", action.destination); }
|
|
116
116
|
const json_value = JSON.parse(action.operation.operands[0].value);
|
|
117
|
-
console.log("(SetAttributeV2) json_value:", json_value);
|
|
117
|
+
if (this.log) { console.log("(SetAttributeV2) json_value:", json_value); }
|
|
118
118
|
await TiledeskChatbot.addParameterStatic(this.context.tdcache, this.context.requestId, action.destination, json_value);
|
|
119
119
|
callback();
|
|
120
120
|
return; // on json types no operations are permitted beyond assignment
|