refactor(api/core/workflow/workflow_engine_manager.py): Remove (#6630)

Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
-LAN- 2024-07-24 19:35:40 +08:00 committed by GitHub
parent 72bc9d5f2b
commit 31efe10c75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,15 +87,18 @@ class WorkflowEngineManager:
return default_config return default_config
def run_workflow(self, *, workflow: Workflow, def run_workflow(
user_id: str, self,
user_from: UserFrom, *,
invoke_from: InvokeFrom, workflow: Workflow,
user_inputs: Mapping[str, Any], user_id: str,
system_inputs: Mapping[SystemVariable, Any], user_from: UserFrom,
callbacks: Sequence[WorkflowCallback], invoke_from: InvokeFrom,
call_depth: int = 0, user_inputs: Mapping[str, Any],
variable_pool: Optional[VariablePool] = None) -> None: system_inputs: Mapping[SystemVariable, Any],
callbacks: Sequence[WorkflowCallback],
call_depth: int = 0
) -> None:
""" """
:param workflow: Workflow instance :param workflow: Workflow instance
:param user_id: user id :param user_id: user id
@ -120,12 +123,11 @@ class WorkflowEngineManager:
raise ValueError('edges in workflow graph must be a list') raise ValueError('edges in workflow graph must be a list')
# init variable pool # init variable pool
if not variable_pool: variable_pool = VariablePool(
variable_pool = VariablePool( system_variables=system_inputs,
system_variables=system_inputs, user_inputs=user_inputs,
user_inputs=user_inputs, environment_variables=workflow.environment_variables,
environment_variables=workflow.environment_variables, )
)
workflow_call_max_depth = dify_config.WORKFLOW_CALL_MAX_DEPTH workflow_call_max_depth = dify_config.WORKFLOW_CALL_MAX_DEPTH
if call_depth > workflow_call_max_depth: if call_depth > workflow_call_max_depth: