@tiledesk/tiledesk-tybot-connector 2.0.30 → 2.0.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "2.0.30",
3
+ "version": "2.0.31",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -252,7 +252,7 @@ class DirAiPrompt {
252
252
 
253
253
  if (publicKey === true) {
254
254
  let tokens_usage = {
255
- tokens: resbody.usage.total_token,
255
+ tokens: resbody.prompt_token_info?.total_tokens || 0,
256
256
  model: json.model
257
257
  }
258
258
  quotasService.updateQuote(this.projectId, this.token, tokens_usage);