@tiledesk/tiledesk-tybot-connector 0.2.66-rc2 → 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
|
@@ -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); }
|