@tiledesk/tiledesk-tybot-connector 0.2.65 → 0.2.66-rc1
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiledesk/tiledesk-tybot-connector",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.66-rc1",
|
|
4
4
|
"description": "Tiledesk Tybot connector",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -24,13 +24,14 @@
|
|
|
24
24
|
"handlebars": "^4.7.7",
|
|
25
25
|
"jsonschema": "^1.4.1",
|
|
26
26
|
"jsonwebtoken": "^8.5.1",
|
|
27
|
+
"liquidjs": "^10.8.4",
|
|
27
28
|
"minimist-string": "^1.0.2",
|
|
28
29
|
"mongoose": "^6.3.5",
|
|
30
|
+
"multer": "^1.4.5-lts.1",
|
|
29
31
|
"nanoid": "^3.1.25",
|
|
30
32
|
"redis": "^3.1.2",
|
|
31
33
|
"uuid": "^3.3.3",
|
|
32
|
-
"vm2": "^3.9.13"
|
|
33
|
-
"liquidjs": "^10.8.4"
|
|
34
|
+
"vm2": "^3.9.13"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"mocha": "^8.4.0"
|
|
@@ -196,7 +196,10 @@ class DirAskGPTV2 {
|
|
|
196
196
|
else if (resbody.success === true) {
|
|
197
197
|
|
|
198
198
|
if (publicKey === true) {
|
|
199
|
-
let token_usage =
|
|
199
|
+
let token_usage = {
|
|
200
|
+
tokens: resbody.prompt_token_size,
|
|
201
|
+
model: json.model
|
|
202
|
+
}
|
|
200
203
|
this.updateQuote(server_base_url, token_usage);
|
|
201
204
|
}
|
|
202
205
|
|
|
@@ -57,6 +57,7 @@ class DirGptTask {
|
|
|
57
57
|
|
|
58
58
|
// default value
|
|
59
59
|
let answer = "No answer.";
|
|
60
|
+
let model = "gpt-3.5-turbo";
|
|
60
61
|
|
|
61
62
|
if (!action.question || action.question === '') {
|
|
62
63
|
console.error("Error: DirGptTask question attribute is mandatory. Executing condition false...")
|
|
@@ -81,6 +82,10 @@ class DirGptTask {
|
|
|
81
82
|
|
|
82
83
|
let max_tokens = action.max_tokens;
|
|
83
84
|
let temperature = action.temperature;
|
|
85
|
+
|
|
86
|
+
if (action.model) {
|
|
87
|
+
model = action.model;
|
|
88
|
+
}
|
|
84
89
|
|
|
85
90
|
if (this.log) {
|
|
86
91
|
console.log("DirGptTask max_tokens: ", max_tokens);
|
|
@@ -180,7 +185,10 @@ class DirGptTask {
|
|
|
180
185
|
await this.#assignAttributes(action, answer_json);
|
|
181
186
|
|
|
182
187
|
if (publicKey === true) {
|
|
183
|
-
let token_usage =
|
|
188
|
+
let token_usage = {
|
|
189
|
+
tokens: resbody.usage.total_tokens,
|
|
190
|
+
model: json.model
|
|
191
|
+
}
|
|
184
192
|
this.updateQuote(server_base_url, token_usage);
|
|
185
193
|
}
|
|
186
194
|
|