the second case of success

This commit is contained in:
lda
2026-05-07 04:21:55 +07:00 Verified
parent 0ef6590184
commit b8f56b78e4
8 changed files with 336 additions and 46 deletions
+1
View File
@@ -18,6 +18,7 @@ class StateField(BaseModel):
type: str
merge_strategy: Literal["replace", "append", "merge_object"] = "replace"
trace: bool = True
default: Any = None
class StateSchema(BaseModel):
+9 -1
View File
@@ -1,15 +1,23 @@
from __future__ import annotations
from copy import deepcopy
from .model import Workflow
from .run_state import ExecutionFrame, FrameStatus, RunState, RunStatus
def create_run_state(workflow: Workflow, workflow_input: dict[str, object]) -> RunState:
state = {
name: deepcopy(field.default)
for name, field in workflow.state_schema.fields.items()
if field.default is not None
}
state.update(dict(workflow_input))
run = RunState(
workflow_name=workflow.name,
status=RunStatus.PENDING,
workflow_input=dict(workflow_input),
state=dict(workflow_input),
state=state,
frames={
"root": ExecutionFrame(
id="root",