@tiledesk/tiledesk-tybot-connector 2.0.21-rc9 → 2.0.22
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 +2 -27
- package/Logger.js +0 -3
- package/TdCache copy.js +242 -0
- package/engine/mock/MockBotsDataSource.js +2 -1
- package/index.js +0 -3
- package/logs/app.log +82 -0
- package/package.json +1 -1
- package/tiledeskChatbotPlugs/DirectivesChatbotPlug.js +11 -29
- package/tiledeskChatbotPlugs/directives/DirAskGPTV2.js +97 -17
- package/tiledeskChatbotPlugs/directives/DirReplyV2.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirWebRequestV2.js +1 -1
- package/tiledeskChatbotPlugs/directives/DirWebRequestV2_old.js +418 -0
- package/tiledeskChatbotPlugs/directives/Directives.js +0 -1
- package/utils/TiledeskChatbotUtil.js +33 -204
- package/utils/constants.js +17 -0
- package/services/LLMService.js +0 -105
- package/services/QuotasService.js +0 -69
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
available on:
|
|
6
6
|
▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
|
|
7
7
|
|
|
8
|
+
# 2.0.9
|
|
9
|
+
|
|
8
10
|
# 2.0.9-rc1
|
|
9
11
|
- removed: speech-to-text management
|
|
10
12
|
|
|
@@ -18,8 +20,6 @@ available on:
|
|
|
18
20
|
|
|
19
21
|
# v0.5.0
|
|
20
22
|
- added: AI_ENDPOINT env var
|
|
21
|
-
|
|
22
|
-
# v0.5.0-rc1
|
|
23
23
|
- added: ability to get 'none' as bodytype in webresponse
|
|
24
24
|
|
|
25
25
|
# v0.4.2
|
|
@@ -34,19 +34,6 @@ available on:
|
|
|
34
34
|
- changed: refactoring of DIrWebRequestv2
|
|
35
35
|
- bug-fixed: erro while parsing webrequestv2 body
|
|
36
36
|
|
|
37
|
-
# v0.3.5-rc4
|
|
38
|
-
- added: webhook action (same as intent one)
|
|
39
|
-
|
|
40
|
-
# v0.3.5-rc3
|
|
41
|
-
- bug-fixed: jsonBody parse error in web-request-v2
|
|
42
|
-
|
|
43
|
-
# v0.3.5-rc2
|
|
44
|
-
- bug-fixed: cannot set status of undefined reading res.status in DirAssistant
|
|
45
|
-
|
|
46
|
-
# v0.3.5-rc1
|
|
47
|
-
- changed: refactoring web-request-v2
|
|
48
|
-
- bug-fixed: jsonBody parse error in web-request-v2
|
|
49
|
-
|
|
50
37
|
# v0.3.4
|
|
51
38
|
-bug-fixed: slit is undefined in TiledeskChatbotUtils
|
|
52
39
|
|
|
@@ -56,18 +43,6 @@ available on:
|
|
|
56
43
|
# v0.3.2
|
|
57
44
|
- bug-fixed: minor improvement
|
|
58
45
|
|
|
59
|
-
# v0.2.153-rc9
|
|
60
|
-
- changed: updated tiledesk-multi-worker to 0.2.1-rc2
|
|
61
|
-
|
|
62
|
-
# v0.2.153-rc8
|
|
63
|
-
- added: fixToken function in TiledeskService utils class
|
|
64
|
-
|
|
65
|
-
# v0.2.153-rc4
|
|
66
|
-
- log added
|
|
67
|
-
|
|
68
|
-
# v0.2.153-rc3
|
|
69
|
-
- added: specchToText function to transcript audio file
|
|
70
|
-
|
|
71
46
|
# v0.2.153-rc1
|
|
72
47
|
- changed: context for gpt-40 and gpt-40-mini
|
|
73
48
|
|
package/Logger.js
CHANGED
|
@@ -12,8 +12,6 @@ let publisher = new Publisher(AMQP_MANAGER_URL, {
|
|
|
12
12
|
exchange: "amq.topic"
|
|
13
13
|
})
|
|
14
14
|
|
|
15
|
-
console.log("LOGGER publisher: ", publisher);
|
|
16
|
-
|
|
17
15
|
class Logger {
|
|
18
16
|
|
|
19
17
|
constructor(config) {
|
|
@@ -94,7 +92,6 @@ class Logger {
|
|
|
94
92
|
}
|
|
95
93
|
|
|
96
94
|
let topic = LOGS_BASE_ROUTING_KEY + `.${this.request_id}`;
|
|
97
|
-
console.log("LOGGER publishing on topic ", topic)
|
|
98
95
|
publisher.publish(data, topic);
|
|
99
96
|
return;
|
|
100
97
|
}
|
package/TdCache copy.js
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
const redis = require('redis');
|
|
2
|
+
|
|
3
|
+
class TdCache {
|
|
4
|
+
|
|
5
|
+
constructor(config) {
|
|
6
|
+
this.redis_host = config.host;
|
|
7
|
+
this.redis_port = config.port;
|
|
8
|
+
this.redis_password = config.password;
|
|
9
|
+
this.client = null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async connect(callback) {
|
|
13
|
+
// client = redis.createClient();
|
|
14
|
+
return new Promise( async (resolve, reject) => {
|
|
15
|
+
this.client = redis.createClient(
|
|
16
|
+
{
|
|
17
|
+
host: this.redis_host,
|
|
18
|
+
port: this.redis_port,
|
|
19
|
+
password: this.redis_password
|
|
20
|
+
});
|
|
21
|
+
this.client.on('error', err => {
|
|
22
|
+
reject(err);
|
|
23
|
+
if (callback) {
|
|
24
|
+
callback(err);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
// this.client.on('connect', function() {
|
|
28
|
+
// console.log('Redis Connected!');
|
|
29
|
+
// });
|
|
30
|
+
this.client.on('ready',function() {
|
|
31
|
+
console.log("connected")
|
|
32
|
+
resolve();
|
|
33
|
+
if (callback) {
|
|
34
|
+
callback();
|
|
35
|
+
}
|
|
36
|
+
//console.log("Redis is ready.");
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async set(key, value, options) {
|
|
42
|
+
//console.log("setting key value", key, value)
|
|
43
|
+
if (!options) {
|
|
44
|
+
options = {EX: 86400}
|
|
45
|
+
}
|
|
46
|
+
return new Promise( async (resolve, reject) => {
|
|
47
|
+
if (options && options.EX) {
|
|
48
|
+
//console.log("expires:", options.EX)
|
|
49
|
+
try {
|
|
50
|
+
await this.client.set(
|
|
51
|
+
key,
|
|
52
|
+
value,
|
|
53
|
+
'EX', options.EX);
|
|
54
|
+
}
|
|
55
|
+
catch(error) {
|
|
56
|
+
reject(error)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
try {
|
|
61
|
+
//console.log("setting here...key", key, value)
|
|
62
|
+
await this.client.set(
|
|
63
|
+
key,
|
|
64
|
+
value);
|
|
65
|
+
}
|
|
66
|
+
catch(error) {
|
|
67
|
+
console.error("Error", error);
|
|
68
|
+
reject(error)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (options && options.callback) {
|
|
72
|
+
options.callback();
|
|
73
|
+
}
|
|
74
|
+
//console.log("resolving...", key);
|
|
75
|
+
return resolve();
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async incr(key) {
|
|
80
|
+
// console.log("incr key:", key)
|
|
81
|
+
return new Promise( async (resolve, reject) => {
|
|
82
|
+
try {
|
|
83
|
+
// console.log("incr here...key", key)
|
|
84
|
+
await this.client.incr(key);
|
|
85
|
+
}
|
|
86
|
+
catch(error) {
|
|
87
|
+
console.error("Error on incr:", error);
|
|
88
|
+
reject(error)
|
|
89
|
+
}
|
|
90
|
+
return resolve();
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async hset(dict_key, key, value, options) {
|
|
95
|
+
//console.log("hsetting dict_key key value", dict_key, key, value)
|
|
96
|
+
return new Promise( async (resolve, reject) => {
|
|
97
|
+
if (options && options.EX) {
|
|
98
|
+
//console.log("expires:", options.EX)
|
|
99
|
+
try {
|
|
100
|
+
await this.client.hset(
|
|
101
|
+
dict_key,
|
|
102
|
+
key,
|
|
103
|
+
value,
|
|
104
|
+
'EX', options.EX);
|
|
105
|
+
}
|
|
106
|
+
catch(error) {
|
|
107
|
+
reject(error)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
try {
|
|
112
|
+
//console.log("setting here...key", key, value)
|
|
113
|
+
await this.client.hset(
|
|
114
|
+
dict_key,
|
|
115
|
+
key,
|
|
116
|
+
value);
|
|
117
|
+
}
|
|
118
|
+
catch(error) {
|
|
119
|
+
console.error("Error", error);
|
|
120
|
+
reject(error)
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (options && options.callback) {
|
|
124
|
+
options.callback();
|
|
125
|
+
}
|
|
126
|
+
return resolve();
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async hdel(dict_key, key, options) {
|
|
131
|
+
//console.log("hsetting dict_key key value", dict_key, key, value)
|
|
132
|
+
return new Promise( async (resolve, reject) => {
|
|
133
|
+
if (options && options.EX) {
|
|
134
|
+
//console.log("expires:", options.EX)
|
|
135
|
+
try {
|
|
136
|
+
await this.client.hdel(
|
|
137
|
+
dict_key,
|
|
138
|
+
key,
|
|
139
|
+
'EX', options.EX);
|
|
140
|
+
}
|
|
141
|
+
catch(error) {
|
|
142
|
+
reject(error)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
try {
|
|
147
|
+
//console.log("setting here...key", key, value)
|
|
148
|
+
await this.client.hdel(
|
|
149
|
+
dict_key,
|
|
150
|
+
key);
|
|
151
|
+
}
|
|
152
|
+
catch(error) {
|
|
153
|
+
console.error("Error", error);
|
|
154
|
+
reject(error);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (options && options.callback) {
|
|
158
|
+
options.callback();
|
|
159
|
+
}
|
|
160
|
+
return resolve();
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
async setJSON(key, value, options) {
|
|
165
|
+
const _string = JSON.stringify(value);
|
|
166
|
+
return await this.set(key, _string, options);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
async get(key, callback) {
|
|
170
|
+
//console.log("getting key", key)
|
|
171
|
+
return new Promise( async (resolve, reject) => {
|
|
172
|
+
this.client.get(key, (err, value) => {
|
|
173
|
+
if (err) {
|
|
174
|
+
reject(err);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
if (callback) {
|
|
178
|
+
callback(value);
|
|
179
|
+
}
|
|
180
|
+
return resolve(value);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
async hgetall(dict_key, callback) {
|
|
187
|
+
//console.log("hgetting dics", dict_key);
|
|
188
|
+
return new Promise( async (resolve, reject) => {
|
|
189
|
+
this.client.hgetall(dict_key, (err, value) => {
|
|
190
|
+
if (err) {
|
|
191
|
+
reject(err);
|
|
192
|
+
if (callback) {
|
|
193
|
+
callback(err, null);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
if (callback) {
|
|
198
|
+
callback(null, value);
|
|
199
|
+
}
|
|
200
|
+
resolve(value);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
async hget(dict_key, key, callback) {
|
|
207
|
+
//console.log("hgetting dics", dict_key);
|
|
208
|
+
return new Promise( async (resolve, reject) => {
|
|
209
|
+
this.client.hget(dict_key, key, (err, value) => {
|
|
210
|
+
if (err) {
|
|
211
|
+
reject(err);
|
|
212
|
+
if (callback) {
|
|
213
|
+
callback(err, null);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
if (callback) {
|
|
218
|
+
callback(null, value);
|
|
219
|
+
}
|
|
220
|
+
resolve(value);
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
async getJSON(key, callback) {
|
|
227
|
+
const value = await this.get(key);
|
|
228
|
+
return JSON.parse(value);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
async del(key, callback) {
|
|
232
|
+
return new Promise( async (resolve, reject) => {
|
|
233
|
+
await this.client.del(key);
|
|
234
|
+
if (callback) {
|
|
235
|
+
callback();
|
|
236
|
+
}
|
|
237
|
+
return resolve();
|
|
238
|
+
})
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
module.exports = { TdCache };
|
package/index.js
CHANGED
package/logs/app.log
CHANGED
|
@@ -12184,3 +12184,85 @@ error: Axios error response data: {"error":"no knowledge base settings found"}
|
|
|
12184
12184
|
error: Error getting kb settings: {"error":"no knowledge base settings found"}
|
|
12185
12185
|
info: DirAskGPTV2 Error: gptkey is mandatory
|
|
12186
12186
|
error: DirAskGPTV2 Error: question attribute is mandatory. Executing condition false...
|
|
12187
|
+
info: Starting tilebot server...
|
|
12188
|
+
info: (Tilebot) Starting Tilebot..
|
|
12189
|
+
info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
|
|
12190
|
+
info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
|
|
12191
|
+
info: (Tilebot) Log Level: info
|
|
12192
|
+
info: (Tilebot) MAX_STEPS: 1000
|
|
12193
|
+
info: (Tilebot) MAX_EXECUTION_TIME: 28800000
|
|
12194
|
+
info: (Tilebot) Starting Tilebot connector v2.0.20
|
|
12195
|
+
info: (Tilebot) Using static bots
|
|
12196
|
+
info: (Tilebot) Connecting Redis...
|
|
12197
|
+
info: (Tilebot) Redis connected
|
|
12198
|
+
info: (Tilebot) Tilebot started
|
|
12199
|
+
info: Tilebot route successfully started.
|
|
12200
|
+
info: Tilebot connector listening on port...
|
|
12201
|
+
info: Starting tilebot server...
|
|
12202
|
+
info: (Tilebot) Starting Tilebot..
|
|
12203
|
+
info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
|
|
12204
|
+
info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
|
|
12205
|
+
info: (Tilebot) Log Level: info
|
|
12206
|
+
info: (Tilebot) MAX_STEPS: 1000
|
|
12207
|
+
info: (Tilebot) MAX_EXECUTION_TIME: 28800000
|
|
12208
|
+
info: (Tilebot) Starting Tilebot connector v2.0.20
|
|
12209
|
+
info: (Tilebot) Using static bots
|
|
12210
|
+
info: (Tilebot) Connecting Redis...
|
|
12211
|
+
info: (Tilebot) Redis connected
|
|
12212
|
+
info: (Tilebot) Tilebot started
|
|
12213
|
+
info: Tilebot route successfully started.
|
|
12214
|
+
info: Tilebot connector listening on port
|
|
12215
|
+
info: Starting tilebot server...
|
|
12216
|
+
info: (Tilebot) Starting Tilebot..
|
|
12217
|
+
info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
|
|
12218
|
+
info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
|
|
12219
|
+
info: (Tilebot) Log Level: info
|
|
12220
|
+
info: (Tilebot) MAX_STEPS: 1000
|
|
12221
|
+
info: (Tilebot) MAX_EXECUTION_TIME: 28800000
|
|
12222
|
+
info: (Tilebot) Starting Tilebot connector v2.0.20
|
|
12223
|
+
info: (Tilebot) Using static bots
|
|
12224
|
+
info: (Tilebot) Connecting Redis...
|
|
12225
|
+
info: (Tilebot) Redis connected
|
|
12226
|
+
info: (Tilebot) Tilebot started
|
|
12227
|
+
info: Tilebot route successfully started.
|
|
12228
|
+
info: Tilebot connector listening on port
|
|
12229
|
+
error: Axios error response data: Integration not found for model undefined
|
|
12230
|
+
error: Error: DirAiPrompt llm key not found in integrations
|
|
12231
|
+
error: Axios error response data: {"detail":[{"loc":["string",0],"msg":"this is the error message","type":"string"}]}
|
|
12232
|
+
error: DirAiPrompt openai err: Request failed with status code 422 {"code":"ERR_BAD_REQUEST","config":{"adapter":["xhr","http","fetch"],"data":"{\"question\":\"this is the question\",\"llm\":\"myllm\",\"model\":\"llmmodel\",\"llm_key\":\"example_api_key\",\"temperature\":0.7,\"max_tokens\":512}","env":{"Blob":null},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Content-Length":"131","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"maxBodyLength":-1,"maxContentLength":-1,"method":"post","timeout":0,"transformRequest":[null],"transformResponse":[null],"transitional":{"clarifyTimeoutError":false,"forcedJSONParsing":true,"silentJSONParsing":true},"url":"http://localhost:10002/api/ask","xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN"},"name":"AxiosError","request":{"_closed":false,"_contentLength":null,"_defaultKeepAlive":true,"_ended":true,"_events":{},"_eventsCount":7,"_hasBody":true,"_header":"POST /api/ask HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/json\r\nUser-Agent: axios/1.7.7\r\nContent-Length: 131\r\nAccept-Encoding: gzip, compress, deflate, br\r\nHost: localhost:10002\r\nConnection: close\r\n\r\n","_headerSent":true,"_keepAliveTimeout":0,"_last":true,"_redirectable":{"_currentRequest":"[Circular]","_currentUrl":"http://localhost:10002/api/ask","_ended":true,"_ending":true,"_events":{},"_eventsCount":3,"_options":{"agents":{},"beforeRedirects":{},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Content-Length":"131","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"hostname":"localhost","maxBodyLength":null,"maxRedirects":21,"method":"POST","nativeProtocols":{"http:":{"METHODS":["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"],"STATUS_CODES":{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"},"globalAgent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{"localhost:10002:":[{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null}]},"totalSocketCount":1},"maxHeaderSize":16384},"https:":{"globalAgent":{"_events":{},"_eventsCount":2,"_sessionCache":{"list":[],"map":{}},"defaultPort":443,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxCachedSessions":100,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"https:","requests":{},"scheduling":"lifo","sockets":{},"totalSocketCount":0}}},"path":"/api/ask","pathname":"/api/ask","port":"10002","protocol":"http:"},"_redirectCount":0,"_redirects":[],"_requestBodyBuffers":[],"_requestBodyLength":131,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":true,"defaultEncoding":"utf8","destroyed":false,"emitClose":true,"ended":false,"ending":false,"errorEmitted":false,"errored":null,"finalCalled":false,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":0,"prefinished":false,"sync":true,"writecb":null,"writelen":0,"writing":false}},"_removedConnection":false,"_removedContLen":false,"_removedTE":false,"_trailer":"","aborted":false,"agent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{"localhost:10002:":[{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null}]},"totalSocketCount":1},"chunkedEncoding":false,"destroyed":false,"finished":true,"host":"localhost","maxHeadersCount":null,"maxRequestsOnConnectionReached":false,"method":"POST","outputData":[],"outputSize":0,"parser":null,"path":"/api/ask","protocol":"http:","res":{"_consuming":false,"_dumped":false,"_events":{"end":[null,null]},"_eventsCount":4,"_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":true,"closed":true,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":true,"emitClose":true,"emittedReadable":false,"encoding":null,"endEmitted":true,"ended":true,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":false,"objectMode":false,"pipes":[],"readableListening":false,"reading":false,"readingMore":true,"resumeScheduled":false,"sync":true},"aborted":false,"client":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"complete":true,"httpVersion":"1.1","httpVersionMajor":1,"httpVersionMinor":1,"method":null,"rawHeaders":["X-Powered-By","Express","Content-Type","application/json; charset=utf-8","Content-Length","83","ETag","W/\"53-r1gE0xIC+8fgNRuH768xfjuFcI8\"","Date","Fri, 04 Jul 2025 13:03:18 GMT","Connection","close"],"rawTrailers":[],"redirects":[],"req":"[Circular]","responseUrl":"http://localhost:10002/api/ask","socket":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"statusCode":422,"statusMessage":"Unprocessable Entity","upgrade":false,"url":""},"reusedSocket":false,"sendDate":false,"shouldKeepAlive":false,"socket":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"timeoutCb":null,"upgradeOrConnect":false,"useChunkedEncodingByDefault":true,"writable":true},"response":{"config":{"adapter":["xhr","http","fetch"],"data":"{\"question\":\"this is the question\",\"llm\":\"myllm\",\"model\":\"llmmodel\",\"llm_key\":\"example_api_key\",\"temperature\":0.7,\"max_tokens\":512}","env":{"Blob":null},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Content-Length":"131","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"maxBodyLength":-1,"maxContentLength":-1,"method":"post","timeout":0,"transformRequest":[null],"transformResponse":[null],"transitional":{"clarifyTimeoutError":false,"forcedJSONParsing":true,"silentJSONParsing":true},"url":"http://localhost:10002/api/ask","xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN"},"data":{"detail":[{"loc":["string",0],"msg":"this is the error message","type":"string"}]},"headers":{"connection":"close","content-length":"83","content-type":"application/json; charset=utf-8","date":"Fri, 04 Jul 2025 13:03:18 GMT","etag":"W/\"53-r1gE0xIC+8fgNRuH768xfjuFcI8\"","x-powered-by":"Express"},"request":{"_closed":false,"_contentLength":null,"_defaultKeepAlive":true,"_ended":true,"_events":{},"_eventsCount":7,"_hasBody":true,"_header":"POST /api/ask HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/json\r\nUser-Agent: axios/1.7.7\r\nContent-Length: 131\r\nAccept-Encoding: gzip, compress, deflate, br\r\nHost: localhost:10002\r\nConnection: close\r\n\r\n","_headerSent":true,"_keepAliveTimeout":0,"_last":true,"_redirectable":{"_currentRequest":"[Circular]","_currentUrl":"http://localhost:10002/api/ask","_ended":true,"_ending":true,"_events":{},"_eventsCount":3,"_options":{"agents":{},"beforeRedirects":{},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Content-Length":"131","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"hostname":"localhost","maxBodyLength":null,"maxRedirects":21,"method":"POST","nativeProtocols":{"http:":{"METHODS":["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"],"STATUS_CODES":{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"},"globalAgent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{"localhost:10002:":[{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null}]},"totalSocketCount":1},"maxHeaderSize":16384},"https:":{"globalAgent":{"_events":{},"_eventsCount":2,"_sessionCache":{"list":[],"map":{}},"defaultPort":443,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxCachedSessions":100,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"https:","requests":{},"scheduling":"lifo","sockets":{},"totalSocketCount":0}}},"path":"/api/ask","pathname":"/api/ask","port":"10002","protocol":"http:"},"_redirectCount":0,"_redirects":[],"_requestBodyBuffers":[],"_requestBodyLength":131,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":true,"defaultEncoding":"utf8","destroyed":false,"emitClose":true,"ended":false,"ending":false,"errorEmitted":false,"errored":null,"finalCalled":false,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":0,"prefinished":false,"sync":true,"writecb":null,"writelen":0,"writing":false}},"_removedConnection":false,"_removedContLen":false,"_removedTE":false,"_trailer":"","aborted":false,"agent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{"localhost:10002:":[{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null}]},"totalSocketCount":1},"chunkedEncoding":false,"destroyed":false,"finished":true,"host":"localhost","maxHeadersCount":null,"maxRequestsOnConnectionReached":false,"method":"POST","outputData":[],"outputSize":0,"parser":null,"path":"/api/ask","protocol":"http:","res":{"_consuming":false,"_dumped":false,"_events":{"end":[null,null]},"_eventsCount":4,"_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":true,"closed":true,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":true,"emitClose":true,"emittedReadable":false,"encoding":null,"endEmitted":true,"ended":true,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":false,"objectMode":false,"pipes":[],"readableListening":false,"reading":false,"readingMore":true,"resumeScheduled":false,"sync":true},"aborted":false,"client":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"complete":true,"httpVersion":"1.1","httpVersionMajor":1,"httpVersionMinor":1,"method":null,"rawHeaders":["X-Powered-By","Express","Content-Type","application/json; charset=utf-8","Content-Length","83","ETag","W/\"53-r1gE0xIC+8fgNRuH768xfjuFcI8\"","Date","Fri, 04 Jul 2025 13:03:18 GMT","Connection","close"],"rawTrailers":[],"redirects":[],"req":"[Circular]","responseUrl":"http://localhost:10002/api/ask","socket":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"statusCode":422,"statusMessage":"Unprocessable Entity","upgrade":false,"url":""},"reusedSocket":false,"sendDate":false,"shouldKeepAlive":false,"socket":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"timeoutCb":null,"upgradeOrConnect":false,"useChunkedEncodingByDefault":true,"writable":true},"status":422,"statusText":"Unprocessable Entity"},"stack":"AxiosError: Request failed with status code 422\n at settle (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:2019:12)\n at IncomingMessage.handleStreamEnd (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:3135:11)\n at IncomingMessage.emit (node:events:525:35)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)\n at Axios.request (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:4287:41)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)","status":422}
|
|
12233
|
+
info: Starting tilebot server...
|
|
12234
|
+
info: (Tilebot) Starting Tilebot..
|
|
12235
|
+
info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
|
|
12236
|
+
info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
|
|
12237
|
+
info: (Tilebot) Log Level: info
|
|
12238
|
+
info: (Tilebot) MAX_STEPS: 1000
|
|
12239
|
+
info: (Tilebot) MAX_EXECUTION_TIME: 28800000
|
|
12240
|
+
info: (Tilebot) Starting Tilebot connector v2.0.20
|
|
12241
|
+
info: (Tilebot) Using static bots
|
|
12242
|
+
info: (Tilebot) Connecting Redis...
|
|
12243
|
+
info: (Tilebot) Redis connected
|
|
12244
|
+
info: (Tilebot) Tilebot started
|
|
12245
|
+
info: Tilebot route successfully started.
|
|
12246
|
+
info: Tilebot connector listening on port 10001
|
|
12247
|
+
error: (DirAskGPT) Error: gptkey is mandatory
|
|
12248
|
+
error: Axios error response data: {"error":"no knowledge base settings found"}
|
|
12249
|
+
error: DirAskGPT Get kb settings error {"error":"no knowledge base settings found"}
|
|
12250
|
+
error: (DirAskGPT) Error: gptkey is mandatory
|
|
12251
|
+
error: (DirAskGPT) Error: question attribute is mandatory. Executing condition false...
|
|
12252
|
+
error: (DirAskGPT) Error: kbid attribute is mandatory. Executing condition false...
|
|
12253
|
+
info: Starting tilebot server...
|
|
12254
|
+
info: (Tilebot) Starting Tilebot..
|
|
12255
|
+
info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
|
|
12256
|
+
info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
|
|
12257
|
+
info: (Tilebot) Log Level: info
|
|
12258
|
+
info: (Tilebot) MAX_STEPS: 1000
|
|
12259
|
+
info: (Tilebot) MAX_EXECUTION_TIME: 28800000
|
|
12260
|
+
info: (Tilebot) Starting Tilebot connector v2.0.20
|
|
12261
|
+
info: (Tilebot) Using static bots
|
|
12262
|
+
info: (Tilebot) Connecting Redis...
|
|
12263
|
+
info: (Tilebot) Redis connected
|
|
12264
|
+
info: (Tilebot) Tilebot started
|
|
12265
|
+
info: Tilebot route successfully started.
|
|
12266
|
+
info: Tilebot connector listening on port 10001
|
|
12267
|
+
error: Axios error: Invalid URL {"code":"ERR_INVALID_URL","input":"undefined/qa","stack":"TypeError [ERR_INVALID_URL]: Invalid URL\n at new NodeError (node:internal/errors:387:5)\n at URL.onParseError (node:internal/url:564:9)\n at new URL (node:internal/url:640:5)\n at dispatchHttpRequest (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:2770:20)\n at /Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:2690:5\n at new Promise (<anonymous>)\n at wrapAsync (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:2670:10)\n at http (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:2708:10)\n at Axios.dispatchRequest (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:4135:10)\n at Axios._request (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:4415:33)\n at Axios.request (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:4282:25)\n at wrap (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:28:15)\n at HttpUtils.request (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/utils/HttpUtils.js:25:5)\n at DirAskGPTV2.go (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/tiledeskChatbotPlugs/directives/DirAskGPTV2.js:312:15)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)"}
|
|
12268
|
+
error: DirAskGPTV2 error:
|
package/package.json
CHANGED
|
@@ -54,13 +54,13 @@ const { DirMoveToUnassigned } = require('./directives/DirMoveToUnassigned');
|
|
|
54
54
|
const { DirAddTags } = require('./directives/DirAddTags');
|
|
55
55
|
const { DirSendWhatsapp } = require('./directives/DirSendWhatsapp');
|
|
56
56
|
const { DirReplaceBotV3 } = require('./directives/DirReplaceBotV3');
|
|
57
|
-
const { DirAiPrompt } = require('./directives/DirAiPrompt');
|
|
57
|
+
const { DirAiTask, DirAiPrompt } = require('./directives/DirAiPrompt');
|
|
58
58
|
const { DirWebResponse } = require('./directives/DirWebResponse');
|
|
59
59
|
const { DirConnectBlock } = require('./directives/DirConnectBlock');
|
|
60
|
-
const { DirAddKbContent } = require('./directives/DirAddKbContent');
|
|
61
|
-
const { DirFlowLog } = require('./directives/DirFlowLog');
|
|
62
60
|
|
|
63
61
|
const winston = require('../utils/winston');
|
|
62
|
+
const { DirFlowLog } = require('./directives/DirFlowLog');
|
|
63
|
+
const { DirAddKbContent } = require('./directives/DirAddKbContent');
|
|
64
64
|
|
|
65
65
|
class DirectivesChatbotPlug {
|
|
66
66
|
|
|
@@ -219,13 +219,14 @@ class DirectivesChatbotPlug {
|
|
|
219
219
|
directive_name = directive.name.toLowerCase();
|
|
220
220
|
}
|
|
221
221
|
if (directive && directive.action) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
222
|
+
const action_id = directive.action["_tdActionId"];
|
|
223
|
+
const locked_action_id = await this.chatbot.currentLockedAction(this.supportRequest.request_id);
|
|
224
|
+
if ( locked_action_id && (locked_action_id !== action_id) ) {
|
|
225
|
+
let next_dir = await this.nextDirective(this.directives);
|
|
226
|
+
this.process(next_dir);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
|
|
229
230
|
}
|
|
230
231
|
if (directive == null || (directive !== null && directive["name"] === undefined)) {
|
|
231
232
|
winston.debug("(DirectivesChatbotPlug) stop process(). directive is (null?): ", directive);
|
|
@@ -703,19 +704,6 @@ class DirectivesChatbotPlug {
|
|
|
703
704
|
}
|
|
704
705
|
});
|
|
705
706
|
}
|
|
706
|
-
else if (directive_name === Directives.WEBHOOK) {
|
|
707
|
-
// console.log(".....DirIntent")
|
|
708
|
-
new DirIntent(context).execute(directive, async (stop) => {
|
|
709
|
-
if (stop) {
|
|
710
|
-
if (context.log) { console.log("Stopping Actions on:", JSON.stringify(directive));}
|
|
711
|
-
this.theend();
|
|
712
|
-
}
|
|
713
|
-
else {
|
|
714
|
-
let next_dir = await this.nextDirective(this.directives);
|
|
715
|
-
this.process(next_dir);
|
|
716
|
-
}
|
|
717
|
-
});
|
|
718
|
-
}
|
|
719
707
|
else if (directive_name === Directives.WEB_RESPONSE) {
|
|
720
708
|
new DirWebResponse(context).execute(directive, async () => {
|
|
721
709
|
let next_dir = await this.nextDirective(this.directives);
|
|
@@ -728,12 +716,6 @@ class DirectivesChatbotPlug {
|
|
|
728
716
|
this.process(next_dir);
|
|
729
717
|
})
|
|
730
718
|
}
|
|
731
|
-
else if (directive_name === Directives.ADD_KB_CONTENT) {
|
|
732
|
-
new DirAddKbContent(context).execute(directive, async () => {
|
|
733
|
-
let next_dir = await this.nextDirective(this.directives);
|
|
734
|
-
this.process(next_dir);
|
|
735
|
-
});
|
|
736
|
-
}
|
|
737
719
|
else {
|
|
738
720
|
let next_dir = await this.nextDirective(this.directives);
|
|
739
721
|
this.process(next_dir);
|