@tiledesk/tiledesk-tybot-connector 2.0.14 → 2.0.15
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
|
@@ -248,7 +248,8 @@ class DirAskGPTV2 {
|
|
|
248
248
|
namespace: namespace,
|
|
249
249
|
model: model,
|
|
250
250
|
citations: citations,
|
|
251
|
-
engine: engine
|
|
251
|
+
engine: engine,
|
|
252
|
+
debug: true
|
|
252
253
|
};
|
|
253
254
|
if (top_k) {
|
|
254
255
|
json.top_k = top_k;
|
|
@@ -305,7 +306,7 @@ class DirAskGPTV2 {
|
|
|
305
306
|
}
|
|
306
307
|
else if (resbody.success === true) {
|
|
307
308
|
winston.debug("DirAskGPTV2 resbody: ", resbody);
|
|
308
|
-
await this.#assignAttributes(action, resbody.answer, resbody.source);
|
|
309
|
+
await this.#assignAttributes(action, resbody.answer, resbody.source, resbody.content_chunks);
|
|
309
310
|
if (publicKey === true) {
|
|
310
311
|
let tokens_usage = {
|
|
311
312
|
tokens: resbody.prompt_token_size,
|
|
@@ -376,7 +377,7 @@ class DirAskGPTV2 {
|
|
|
376
377
|
}
|
|
377
378
|
}
|
|
378
379
|
|
|
379
|
-
async #assignAttributes(action, answer, source) {
|
|
380
|
+
async #assignAttributes(action, answer, source, chunks) {
|
|
380
381
|
winston.debug("DirAskGPTV2assignAttributes action: ", action)
|
|
381
382
|
winston.debug("DirAskGPTV2assignAttributes answer: ", answer)
|
|
382
383
|
winston.debug("DirAskGPTV2assignAttributes source: ", source)
|
|
@@ -387,6 +388,9 @@ class DirAskGPTV2 {
|
|
|
387
388
|
if (action.assignSourceTo && source) {
|
|
388
389
|
await TiledeskChatbot.addParameterStatic(this.context.tdcache, this.context.requestId, action.assignSourceTo, source);
|
|
389
390
|
}
|
|
391
|
+
if (action.assignChunksTo && chunks) {
|
|
392
|
+
await TiledeskChatbot.addParameterStatic(this.context.tdcache, this.context.requestId, action.assignChunksTo, chunks);
|
|
393
|
+
}
|
|
390
394
|
}
|
|
391
395
|
}
|
|
392
396
|
|