Fix merge conflicts

This commit is contained in:
Ilango
2024-03-12 13:29:30 +05:30
153 changed files with 30773 additions and 539 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ import logger from './utils/logger'
import { expressRequestLogger } from './utils/logger'
import { v4 as uuidv4 } from 'uuid'
import OpenAI from 'openai'
import { FindOptionsWhere, MoreThanOrEqual, LessThanOrEqual, Between } from 'typeorm'
import { DataSource, FindOptionsWhere, MoreThanOrEqual, LessThanOrEqual, Between } from 'typeorm'
import {
IChatFlow,
IncomingInput,
@@ -92,7 +92,7 @@ export class App {
chatflowPool: ChatflowPool
cachePool: CachePool
telemetry: Telemetry
AppDataSource = getDataSource()
AppDataSource: DataSource = getDataSource()
constructor() {
this.app = express()
+5
View File
@@ -299,6 +299,8 @@ export const buildFlow = async (
exploredNode[startingNodeIds[i]] = { remainingLoop: maxLoop, lastSeenDepth: 0 }
}
const initializedNodes: Set<string> = new Set()
const reversedGraph = constructGraphs(reactFlowNodes, reactFlowEdges, { isReversed: true }).graph
while (nodeQueue.length) {
const { nodeId, depth } = nodeQueue.shift() as INodeQueue
@@ -384,6 +386,7 @@ export const buildFlow = async (
flowNodes[nodeIndex].data.instance = outputResult
logger.debug(`[server]: Finished initializing ${reactFlowNode.data.label} (${reactFlowNode.data.id})`)
initializedNodes.add(reactFlowNode.data.id)
}
} catch (e: any) {
logger.error(e)
@@ -406,6 +409,8 @@ export const buildFlow = async (
for (let i = 0; i < neighbourNodeIds.length; i += 1) {
const neighNodeId = neighbourNodeIds[i]
if (ignoreNodeIds.includes(neighNodeId)) continue
if (initializedNodes.has(neighNodeId)) continue
if (reversedGraph[neighNodeId].some((dependId) => !initializedNodes.has(dependId))) continue
// If nodeId has been seen, cycle detected
if (Object.prototype.hasOwnProperty.call(exploredNode, neighNodeId)) {
const { remainingLoop, lastSeenDepth } = exploredNode[neighNodeId]