Chore/remove app server functions from utils file (#3671)

* remove app server functions from utils file

* hide override config variables if its empty
This commit is contained in:
Henry Heng
2024-12-10 14:11:29 +00:00
committed by GitHub
parent ddca80d4e0
commit 5c5416240b
7 changed files with 55 additions and 16 deletions
@@ -57,6 +57,7 @@ import { getErrorMessage } from '../errors/utils'
import { ChatMessage } from '../database/entities/ChatMessage'
import { IAction } from 'flowise-components'
import { FLOWISE_METRIC_COUNTERS, FLOWISE_COUNTER_STATUS } from '../Interface.Metrics'
import { Variable } from '../database/entities/Variable'
/**
* Build Chatflow
@@ -350,6 +351,7 @@ export const utilBuildChatflow = async (req: Request, isInternal: boolean = fals
const startingNodes = nodes.filter((nd) => startingNodeIds.includes(nd.id))
/*** Get API Config ***/
const availableVariables = await appServer.AppDataSource.getRepository(Variable).find()
const { nodeOverrides, variableOverrides, apiOverrideStatus } = getAPIOverrideConfig(chatflow)
logger.debug(`[server]: Start building chatflow ${chatflowid}`)
@@ -373,6 +375,7 @@ export const utilBuildChatflow = async (req: Request, isInternal: boolean = fals
overrideConfig: incomingInput?.overrideConfig,
apiOverrideStatus,
nodeOverrides,
availableVariables,
variableOverrides,
cachePool: appServer.cachePool,
isUpsert: false,
@@ -427,6 +430,7 @@ export const utilBuildChatflow = async (req: Request, isInternal: boolean = fals
chatHistory,
flowData,
uploadedFilesContent,
availableVariables,
variableOverrides
)
nodeToExecuteData = reactFlowNodeData