Remove hardcoded scraper command to let LLM orchestrator handle it
This commit is contained in:
parent
8c9df40760
commit
c848385ebb
|
|
@ -110,25 +110,7 @@ client.on('message_create', async msg => {
|
||||||
// Target Jid is where the bot should reply.
|
// Target Jid is where the bot should reply.
|
||||||
const targetJid = msg.fromMe ? msg.to : msg.from;
|
const targetJid = msg.fromMe ? msg.to : msg.from;
|
||||||
|
|
||||||
// Custom command for utility scraper
|
// Forward the message to the new LangChain/Gemini orchestrator
|
||||||
if (text.toLowerCase().includes('run scraper') || text.toLowerCase().includes('check utility')) {
|
|
||||||
client.sendMessage(targetJid, '⚡ Triggering utility scraper in background... You will receive the report shortly!');
|
|
||||||
try {
|
|
||||||
const http = require('http');
|
|
||||||
const req = http.request({
|
|
||||||
hostname: 'utility-agent.ai-agents.svc.cluster.local',
|
|
||||||
port: 5005,
|
|
||||||
path: '/api/run',
|
|
||||||
method: 'POST'
|
|
||||||
});
|
|
||||||
req.on('error', err => console.error('[WhatsApp Bot] Failed to trigger scraper:', err));
|
|
||||||
req.end();
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = JSON.stringify({
|
const data = JSON.stringify({
|
||||||
text: text,
|
text: text,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue