fix(workflow): Take back LLM streaming output after IF-ELSE (#9875)

This commit is contained in:
-LAN- 2024-10-25 22:33:34 +08:00 committed by GitHub
commit 72ea3d6b98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 14 deletions

View file

@ -130,15 +130,14 @@ class GraphEngine:
yield GraphRunStartedEvent()
try:
stream_processor_cls: type[AnswerStreamProcessor | EndStreamProcessor]
if self.init_params.workflow_type == WorkflowType.CHAT:
stream_processor_cls = AnswerStreamProcessor
stream_processor = AnswerStreamProcessor(
graph=self.graph, variable_pool=self.graph_runtime_state.variable_pool
)
else:
stream_processor_cls = EndStreamProcessor
stream_processor = stream_processor_cls(
graph=self.graph, variable_pool=self.graph_runtime_state.variable_pool
)
stream_processor = EndStreamProcessor(
graph=self.graph, variable_pool=self.graph_runtime_state.variable_pool
)
# run graph
generator = stream_processor.process(self._run(start_node_id=self.graph.root_node_id))