mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-04-26 06:45:00 +00:00
24 lines
1.1 KiB
Python
24 lines
1.1 KiB
Python
"""Build workflow engine with dependencies."""
|
|
from ..workflow.engine import WorkflowEngine
|
|
from ..workflow.input_resolver import InputResolver
|
|
from ..workflow.loop_executor import LoopExecutor
|
|
from ..workflow.node_executor import NodeExecutor
|
|
from ..workflow.plugin_registry import PluginRegistry, load_plugin_map
|
|
from ..workflow.runtime import WorkflowRuntime
|
|
from ..workflow.tool_runner import ToolRunner
|
|
|
|
|
|
def build_workflow_engine(workflow_config: dict, context: dict, logger):
|
|
"""Assemble workflow engine dependencies."""
|
|
runtime = WorkflowRuntime(context=context, store={}, tool_runner=None, logger=logger)
|
|
tool_runner = ToolRunner(context["tool_map"], context["msgs"], logger)
|
|
runtime.tool_runner = tool_runner
|
|
|
|
plugin_registry = PluginRegistry(load_plugin_map())
|
|
input_resolver = InputResolver(runtime.store)
|
|
loop_executor = LoopExecutor(runtime, input_resolver)
|
|
node_executor = NodeExecutor(runtime, plugin_registry, input_resolver, loop_executor)
|
|
loop_executor.set_node_executor(node_executor)
|
|
|
|
return WorkflowEngine(workflow_config, node_executor, logger)
|