diff --git a/.gitignore b/.gitignore
index 173aee38c..afdbd5ccf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,3 +30,4 @@ yarn-lock.json
logo.svg
screenshot.png
data.db
+.wwebjs_cache
diff --git a/.wwebjs_cache/2.3000.1017045687.html b/.wwebjs_cache/2.3000.1017045687.html
deleted file mode 100644
index ffcdb2779..000000000
--- a/.wwebjs_cache/2.3000.1017045687.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-WhatsApp Web
-
-WhatsApp
Protegida com a criptografia de ponta a ponta
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.wwebjs_cache/2.3000.1017050905.html b/.wwebjs_cache/2.3000.1017050905.html
deleted file mode 100644
index f36b4faaa..000000000
--- a/.wwebjs_cache/2.3000.1017050905.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-WhatsApp Web
-
-WhatsApp
Protegida com a criptografia de ponta a ponta
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.wwebjs_cache/2.3000.1017054665.html b/.wwebjs_cache/2.3000.1017054665.html
deleted file mode 100644
index 6b0868120..000000000
--- a/.wwebjs_cache/2.3000.1017054665.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-WhatsApp Web
-
-WhatsApp
Protegida com a criptografia de ponta a ponta
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/basic.gblib/services/DialogKeywords.ts b/packages/basic.gblib/services/DialogKeywords.ts
index 48a971da2..5d1f4b70a 100644
--- a/packages/basic.gblib/services/DialogKeywords.ts
+++ b/packages/basic.gblib/services/DialogKeywords.ts
@@ -650,7 +650,7 @@ export class DialogKeywords {
*
*/
public async sendTemplateTo({ pid, mobile, filename }) {
- const { min, user, proc } = await DialogKeywords.getProcessInfo(pid);
+ const { min } = await DialogKeywords.getProcessInfo(pid);
GBLogEx.info(min, `SEND TEMPLATE TO '${mobile}',filename '${filename}'.`);
const service = new GBConversationalService(min.core);
diff --git a/packages/core.gbapp/services/GBMinService.ts b/packages/core.gbapp/services/GBMinService.ts
index 266331312..da54b5f00 100644
--- a/packages/core.gbapp/services/GBMinService.ts
+++ b/packages/core.gbapp/services/GBMinService.ts
@@ -1378,7 +1378,7 @@ export class GBMinService {
// a upload with no Dialog, so run Auto Save to .gbdrive.
const t = new SystemKeywords();
- GBLogEx.info(min, `BASIC (${min.botId}): Upload done for ${attachmentData.filename}.`);
+ GBLogEx.info(min, `BASIC (${min.botId}): Upload2 done for ${attachmentData.filename}.`);
const handle = WebAutomationServices.cyrb53({ pid: 0, str: min.botId + attachmentData.filename });
let data = await fs.readFile(attachmentData.filename);
diff --git a/packages/llm.gblib/services/ChatServices.ts b/packages/llm.gblib/services/ChatServices.ts
index 70eee6963..794217405 100644
--- a/packages/llm.gblib/services/ChatServices.ts
+++ b/packages/llm.gblib/services/ChatServices.ts
@@ -108,9 +108,11 @@ export class GBLLMOutputParser extends BaseLLMOutputParser {
private toolChain: RunnableSequence;
private min;
+ private user;
- constructor(min, toolChain: RunnableSequence, documentChain: RunnableSequence) {
+ constructor(min, user, toolChain: RunnableSequence, documentChain: RunnableSequence) {
super();
+ this.user = user;
this.min = min;
this.toolChain = toolChain;
}
@@ -150,8 +152,18 @@ export class GBLLMOutputParser extends BaseLLMOutputParser {
if (localName) {
const pngs = await GBUtil.pdfPageAsImage(this.min, localName, source.page);
- text = `
- ${text}`;
+
+ if (!isNaN(this.user.userSystemId)){
+ await this.min.whatsAppDirectLine.sendFileToDevice(
+ this.user.userSystemId, pngs[0].url,
+ localName, null, undefined, true);
+
+ }
+ else
+ {
+ text = `
+ ${text}`;
+ }
found = true;
source.file = localName;
}
@@ -495,7 +507,7 @@ export class ChatServices {
},
combineDocumentsPrompt,
model,
- new GBLLMOutputParser(min, null, null)
+ new GBLLMOutputParser(min, user, null, null)
] as any);
const conversationalToolChain = RunnableSequence.from([
@@ -508,7 +520,7 @@ export class ChatServices {
},
questionGeneratorTemplate,
modelWithTools,
- new GBLLMOutputParser(min, callToolChain, docsContext?.docstore?._docs.length > 0 ? combineDocumentsChain : null),
+ new GBLLMOutputParser(min, user, callToolChain, docsContext?.docstore?._docs.length > 0 ? combineDocumentsChain : null),
new StringOutputParser()
] as any);
diff --git a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts
index dbbcb5181..5eac02fe8 100644
--- a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts
+++ b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts
@@ -743,7 +743,7 @@ export class WhatsappDirectLine extends GBService {
to = to + '@c.us';
}
}
- GBLogEx.info(this.min, `WhatsApp isViewOnce 2${isViewOnce}`);
+ GBLogEx.info(this.min, `WhatsApp isViewOnce ${isViewOnce}`);
await this.customClient.sendMessage(to, attachment, { caption: caption, isViewOnce });
break;
}