disabled ouput parser streaming

This commit is contained in:
Henry
2023-10-31 14:07:29 +00:00
parent 8857530f29
commit f57a08f59b
11 changed files with 32 additions and 28 deletions
-3
View File
@@ -998,10 +998,7 @@ export class App {
analytic: chatflow.analytic
})
result = typeof result === 'string' ? { text: result } : result
logger.debug(`[server]: Finished running ${nodeToExecuteData.label} (${nodeToExecuteData.id})`)
return res.json(result)
} catch (e: any) {
logger.error('[server]: Error:', e)
+10 -1
View File
@@ -804,7 +804,16 @@ export const isFlowValidForStream = (reactFlowNodes: IReactFlowNode[], endingNod
isValidChainOrAgent = whitelistAgents.includes(endingNodeData.name)
}
return isChatOrLLMsExist && isValidChainOrAgent
// If no output parser, flow is available to stream
let isOutputParserExist = false
for (const flowNode of reactFlowNodes) {
const data = flowNode.data
if (data.category.includes('Output Parser')) {
isOutputParserExist = true
}
}
return isChatOrLLMsExist && isValidChainOrAgent && !isOutputParserExist
}
/**