@tiledesk/tiledesk-tybot-connector 0.2.66-rc1 → 0.2.66-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,10 @@
5
5
  available on:
6
6
  ▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
7
7
 
8
+ # v0.2.66-rc3
9
+ - changed updateQuotes method
10
+ - fix missing model in updateQuote
11
+
8
12
  # v0.2.66-rc1
9
13
  - fix missing model in updateQuote
10
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "0.2.66-rc1",
3
+ "version": "0.2.66-rc3",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -196,11 +196,11 @@ class DirAskGPTV2 {
196
196
  else if (resbody.success === true) {
197
197
 
198
198
  if (publicKey === true) {
199
- let token_usage = {
199
+ let tokens_usage = {
200
200
  tokens: resbody.prompt_token_size,
201
201
  model: json.model
202
202
  }
203
- this.updateQuote(server_base_url, token_usage);
203
+ this.updateQuote(server_base_url, tokens_usage);
204
204
  }
205
205
 
206
206
  if (trueIntent) {
@@ -427,7 +427,7 @@ class DirAskGPTV2 {
427
427
  })
428
428
  }
429
429
 
430
- async updateQuote(server_base_url, tokens) {
430
+ async updateQuote(server_base_url, tokens_usage) {
431
431
  return new Promise((resolve) => {
432
432
 
433
433
  const HTTPREQUEST = {
@@ -436,7 +436,7 @@ class DirAskGPTV2 {
436
436
  'Content-Type': 'application/json',
437
437
  'Authorization': 'JWT ' + this.context.token
438
438
  },
439
- json: { tokens: tokens },
439
+ json: tokens_usage,
440
440
  method: "POST"
441
441
  }
442
442
  if (this.log) { console.log("DirAskGPT check quote availability HTTPREQUEST", HTTPREQUEST); }
@@ -185,11 +185,11 @@ class DirGptTask {
185
185
  await this.#assignAttributes(action, answer_json);
186
186
 
187
187
  if (publicKey === true) {
188
- let token_usage = {
188
+ let tokens_usage = {
189
189
  tokens: resbody.usage.total_tokens,
190
190
  model: json.model
191
191
  }
192
- this.updateQuote(server_base_url, token_usage);
192
+ this.updateQuote(server_base_url, tokens_usage);
193
193
  }
194
194
 
195
195
  if (trueIntent) {
@@ -420,7 +420,7 @@ class DirGptTask {
420
420
  })
421
421
  }
422
422
 
423
- async updateQuote(server_base_url, tokens) {
423
+ async updateQuote(server_base_url, tokens_usage) {
424
424
  return new Promise((resolve) => {
425
425
 
426
426
  const HTTPREQUEST = {
@@ -429,7 +429,7 @@ class DirGptTask {
429
429
  'Content-Type': 'application/json',
430
430
  'Authorization': 'JWT ' + this.context.token
431
431
  },
432
- json: { tokens: tokens },
432
+ json: tokens_usage,
433
433
  method: "POST"
434
434
  }
435
435
  if (this.log) { console.log("DirGptTask check quote availability HTTPREQUEST", HTTPREQUEST); }