@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
package/package.json
CHANGED
|
@@ -196,11 +196,11 @@ class DirAskGPTV2 {
|
|
|
196
196
|
else if (resbody.success === true) {
|
|
197
197
|
|
|
198
198
|
if (publicKey === true) {
|
|
199
|
-
let
|
|
199
|
+
let tokens_usage = {
|
|
200
200
|
tokens: resbody.prompt_token_size,
|
|
201
201
|
model: json.model
|
|
202
202
|
}
|
|
203
|
-
this.updateQuote(server_base_url,
|
|
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,
|
|
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:
|
|
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
|
|
188
|
+
let tokens_usage = {
|
|
189
189
|
tokens: resbody.usage.total_tokens,
|
|
190
190
|
model: json.model
|
|
191
191
|
}
|
|
192
|
-
this.updateQuote(server_base_url,
|
|
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,
|
|
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:
|
|
432
|
+
json: tokens_usage,
|
|
433
433
|
method: "POST"
|
|
434
434
|
}
|
|
435
435
|
if (this.log) { console.log("DirGptTask check quote availability HTTPREQUEST", HTTPREQUEST); }
|