@tiledesk/tiledesk-tybot-connector 0.2.91-rc2 → 0.2.91-rc3

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,13 @@
5
5
  available on:
6
6
  ▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
7
7
 
8
+ # v0.2.91
9
+ - Added voice flow attributes: dnis, callId, ani
10
+
11
+ # v0.2.89
12
+ - Added convertToNumber to operations in setAttribute
13
+ - Added setAttributeV2 test
14
+
8
15
  # v0.2.88
9
16
  - Added DirContactUpdate (aka LeadUpdate). No test case added for LeadUpdate. Only testable with a validation test.
10
17
  - Fixed: Attribute parameters userFullname & userEmail now are able to "bypass" the request.lead not correctly updating on the same conversation. If updated in the flow (through LeadUpdate action), they will maintain their own value through the current conversation flow.
@@ -714,7 +714,7 @@ class TiledeskChatbotUtil {
714
714
  const value_type = typeof value;
715
715
  //if (projectId === "641864da99c1fb00131ba495") {console.log("641864da99c1fb00131ba495 > importing payload parameter:", key, "value:", value, "type:", value_type);}
716
716
  //await chatbot.addParameter(key, String(value));
717
- console.log("Adding from message.attributes:", key, "->", value);
717
+ // console.log("Adding from message.attributes:", key, "->", value);
718
718
  await chatbot.addParameter(key, value);
719
719
  }
720
720
  }
@@ -722,6 +722,17 @@ class TiledeskChatbotUtil {
722
722
  console.error("Error importing message payload in request variables:", err);
723
723
  }
724
724
  }
725
+
726
+ // voice-vxml attributes
727
+ if (message.attributes.dnis) {
728
+ await chatbot.addParameter("dnis", message.attributes.dnis);
729
+ }
730
+ if (message.attributes.callId) {
731
+ await chatbot.addParameter("callId", message.attributes.callId);
732
+ }
733
+ if (message.attributes.ani) {
734
+ await chatbot.addParameter("ani", message.attributes.ani);
735
+ }
725
736
  }
726
737
 
727
738
  const _bot = chatbot.bot; // aka FaqKB
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "0.2.91-rc2",
3
+ "version": "0.2.91-rc3",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -163,27 +163,22 @@ class DirGptTask {
163
163
  temperature: action.temperature,
164
164
  }
165
165
 
166
- let message = { role: "", content: "" };
167
-
168
166
  if (action.context) {
169
- let message = {
170
- role: "system",
171
- content: filled_context
172
- }
167
+ let message = { role: "system", content: filled_context }
173
168
  json.messages.push(message);
174
169
  }
175
170
 
176
171
  if (transcript) {
177
172
  transcript.forEach(msg => {
178
173
  if (!msg.content.startsWith('/')) {
179
- let message = {
180
- role: msg.role,
181
- content: msg.content
182
- }
174
+ let message = { role: msg.role, content: msg.content }
183
175
  json.messages.push(message)
184
176
  }
185
177
  })
186
- }
178
+ } else {
179
+ let message = { role: "user", content: filled_question };
180
+ json.messages.push(message);
181
+ }
187
182
 
188
183
  if (this.log) { console.log("DirGptTask json: ", json) }
189
184