@tiledesk/tiledesk-tybot-connector 2.0.29-rc2 → 2.0.29-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/ExtApi.js CHANGED
@@ -32,7 +32,6 @@ class ExtApi {
32
32
  * @param {string} token. User token
33
33
  */
34
34
  sendSupportMessageExt(message, projectId, requestId, token, callback) {
35
- const t4 = Date.now();
36
35
  const jwt_token = this.fixToken(token);
37
36
  const url = `${this.TILEBOT_ENDPOINT}/ext/${projectId}/requests/${requestId}/messages`;
38
37
  winston.verbose("(ExtApi) sendSupportMessageExt URL" + url);
@@ -54,8 +53,6 @@ class ExtApi {
54
53
  }
55
54
  }
56
55
  else {
57
- const t4e = Date.now();
58
- console.log(`[TIMER] sendSupportMessageExt in ${t4e - t4}ms ------ ${requestId}`);
59
56
  if (callback) {
60
57
  callback(null, resbody);
61
58
  }
package/Logger.js CHANGED
@@ -12,8 +12,6 @@ let publisher = new Publisher(AMQP_MANAGER_URL, {
12
12
  exchange: "amq.topic"
13
13
  })
14
14
 
15
- console.log("LOGGER publisher: ", publisher);
16
-
17
15
  class Logger {
18
16
 
19
17
  constructor(config) {
package/index.js CHANGED
@@ -176,11 +176,9 @@ router.post('/ext/:botid', async (req, res) => {
176
176
  }
177
177
  );
178
178
  const t1e = Date.now();
179
- console.log(`[TIMER] Preparation phase in ${t1e - t1}ms ------ ${requestId}`);
180
179
  const t2 = Date.now();
181
180
  directivesPlug.processDirectives( () => {
182
181
  const t2e = Date.now();
183
- console.log(`[TIMER] Directives executed in ${t2e - t2}ms ------ ${requestId}`);
184
182
  winston.verbose("(tybotRoute) Actions - Directives executed.");
185
183
  });
186
184
  }
@@ -204,7 +202,6 @@ router.post('/ext/:botid', async (req, res) => {
204
202
  });
205
203
  apiext.sendSupportMessageExt(reply, projectId, requestId, token, () => {
206
204
  const ttotale = Date.now()
207
- console.log(`[TIMER] Directives executed in ${ttotal - ttotale}ms ------ ${requestId}`);
208
205
  winston.verbose("(tybotRoute) sendSupportMessageExt reply sent: ", reply)
209
206
  });
210
207
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "2.0.29-rc2",
3
+ "version": "2.0.29-rc3",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -210,7 +210,7 @@ class DirectivesChatbotPlug {
210
210
  }
211
211
 
212
212
  async process(directive) {
213
- const t3 = Date.now();
213
+
214
214
  let context = this.context;
215
215
  if (directive) {
216
216
  winston.verbose("(DirectivesChatbotPlug) directive['name']: " + directive["name"]);
@@ -451,8 +451,7 @@ class DirectivesChatbotPlug {
451
451
  else if (directive_name === Directives.WAIT) {
452
452
  new DirWait(context).execute(directive, async () => {
453
453
  let next_dir = await this.nextDirective(this.directives);
454
- const t3e = Date.now();
455
- console.log(`[TIMER] Single wait executed in ${t3e - t3}ms`);
454
+
456
455
  this.process(next_dir);
457
456
  });
458
457
  }
@@ -707,7 +706,6 @@ class DirectivesChatbotPlug {
707
706
  });
708
707
  }
709
708
  else if (directive_name === Directives.WEBHOOK) {
710
- // console.log(".....DirIntent")
711
709
  new DirIntent(context).execute(directive, async (stop) => {
712
710
  if (stop) {
713
711
  if (context.log) { console.log("Stopping Actions on:", JSON.stringify(directive));}
@@ -121,7 +121,6 @@ class DirAiPrompt {
121
121
  let publicKey = false;
122
122
  let ollama_integration;
123
123
 
124
- console.log("\n\naction llm: ", action.llm);
125
124
  if (action.llm === 'ollama') {
126
125
  ollama_integration = await integrationService.getIntegration(this.projectId, action.llm, this.token).catch( async (err) => {
127
126
  this.logger.error("[AI Prompt] Error getting ollama integration.")
@@ -139,9 +138,7 @@ class DirAiPrompt {
139
138
  } else {
140
139
  key = await integrationService.getKeyFromIntegrations(this.projectId, action.llm, this.token);
141
140
 
142
- console.log("\n\nKey not found (?): ", key);
143
141
  if (!key && action.llm === "openai") {
144
- console.log("\n\naction llm is openai: ", action.llm);
145
142
  this.logger.native("[AI Prompt] OpenAI key not found in Integration. Retrieve shared OpenAI key.")
146
143
  key = process.env.GPTKEY;
147
144
  publicKey = true;
@@ -196,7 +193,6 @@ class DirAiPrompt {
196
193
  temperature: action.temperature,
197
194
  max_tokens: action.max_tokens
198
195
  }
199
- console.log("\n\njson: ", json)
200
196
 
201
197
  if (action.context) {
202
198
  json.system_context = filled_context;