refactor pipeline and remove node run run_args

This commit is contained in:
takatost
2024-03-09 19:05:48 +08:00
parent 4c5822fb6e
commit 2f57d090a1
11 changed files with 201 additions and 114 deletions

View File

@ -19,14 +19,17 @@ class ValueType(Enum):
class VariablePool:
variables_mapping = {}
user_inputs: dict
def __init__(self, system_variables: dict[SystemVariable, Any]) -> None:
def __init__(self, system_variables: dict[SystemVariable, Any],
user_inputs: dict) -> None:
# system variables
# for example:
# {
# 'query': 'abc',
# 'files': []
# }
self.user_inputs = user_inputs
for system_variable, value in system_variables.items():
self.append_variable('sys', [system_variable.value], value)

View File

@ -18,15 +18,13 @@ class WorkflowNodeAndResult:
class WorkflowRunState:
workflow: Workflow
start_at: float
user_inputs: dict
variable_pool: VariablePool
total_tokens: int = 0
workflow_nodes_and_results: list[WorkflowNodeAndResult] = []
def __init__(self, workflow: Workflow, start_at: float, user_inputs: dict, variable_pool: VariablePool):
def __init__(self, workflow: Workflow, start_at: float, variable_pool: VariablePool):
self.workflow = workflow
self.start_at = start_at
self.user_inputs = user_inputs
self.variable_pool = variable_pool