Add condition to skip initializing web scraper nodes during prediction

This commit is contained in:
Ilango
2024-01-25 11:23:11 +05:30
parent 6395b121b4
commit 3abfa13587
+8
View File
@@ -328,6 +328,14 @@ export const buildLangchain = async (
logger.debug(`[server]: Finished upserting ${reactFlowNode.data.label} (${reactFlowNode.data.id})`)
break
} else {
// skip initializing web scraper nodes during prediction since they would have already run as a part of upsert
if (
reactFlowNode.data.name === 'cheerioWebScraper' ||
reactFlowNode.data.name === 'playwrightWebScraper' ||
reactFlowNode.data.name === 'puppeteerWebScraper'
) {
continue
}
logger.debug(`[server]: Initializing ${reactFlowNode.data.label} (${reactFlowNode.data.id})`)
let outputResult = await newNodeInstance.init(reactFlowNodeData, question, {
chatId,