From 04bbf540d9a55c3ea001b6b5d14634b73ca837a6 Mon Sep 17 00:00:00 2001 From: -LAN- Date: Thu, 4 Sep 2025 02:33:53 +0800 Subject: [PATCH] chore: code format Signed-off-by: -LAN- --- api/core/workflow/graph/__init__.py | 2 +- api/core/workflow/graph/graph_runtime_state_protocol.py | 4 ++-- api/core/workflow/graph/read_only_state_wrapper.py | 4 ++-- api/core/workflow/graph_engine/graph_engine.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/core/workflow/graph/__init__.py b/api/core/workflow/graph/__init__.py index 900e704b65..31a81d494e 100644 --- a/api/core/workflow/graph/__init__.py +++ b/api/core/workflow/graph/__init__.py @@ -10,7 +10,7 @@ __all__ = [ "GraphTemplate", "NodeFactory", "ReadOnlyGraphRuntimeState", - "ReadOnlyVariablePool", "ReadOnlyGraphRuntimeStateWrapper", + "ReadOnlyVariablePool", "ReadOnlyVariablePoolWrapper", ] diff --git a/api/core/workflow/graph/graph_runtime_state_protocol.py b/api/core/workflow/graph/graph_runtime_state_protocol.py index 173076eb19..a5c8db333a 100644 --- a/api/core/workflow/graph/graph_runtime_state_protocol.py +++ b/api/core/workflow/graph/graph_runtime_state_protocol.py @@ -18,7 +18,7 @@ class ReadOnlyVariablePool(Protocol): class ReadOnlyGraphRuntimeState(Protocol): """ Read-only view of GraphRuntimeState for layers. - + This protocol defines a read-only interface that prevents layers from modifying the graph runtime state while still allowing observation. All methods return defensive copies to ensure immutability. @@ -56,4 +56,4 @@ class ReadOnlyGraphRuntimeState(Protocol): def get_output(self, key: str, default: Any = None) -> Any: """Get a single output value (returns a copy).""" - ... \ No newline at end of file + ... diff --git a/api/core/workflow/graph/read_only_state_wrapper.py b/api/core/workflow/graph/read_only_state_wrapper.py index f643baf5fc..3562106a4c 100644 --- a/api/core/workflow/graph/read_only_state_wrapper.py +++ b/api/core/workflow/graph/read_only_state_wrapper.py @@ -31,7 +31,7 @@ class ReadOnlyVariablePoolWrapper: class ReadOnlyGraphRuntimeStateWrapper: """ Wrapper that provides read-only access to GraphRuntimeState. - + This wrapper ensures that layers can observe the state without modifying it. All returned values are defensive copies. """ @@ -73,4 +73,4 @@ class ReadOnlyGraphRuntimeStateWrapper: def get_output(self, key: str, default: Any = None) -> Any: """Get a single output value (returns a copy).""" - return self._state.get_output(key, default) \ No newline at end of file + return self._state.get_output(key, default) diff --git a/api/core/workflow/graph_engine/graph_engine.py b/api/core/workflow/graph_engine/graph_engine.py index fbb63dff8b..fb3c0aadf6 100644 --- a/api/core/workflow/graph_engine/graph_engine.py +++ b/api/core/workflow/graph_engine/graph_engine.py @@ -16,8 +16,8 @@ from flask import Flask, current_app from core.app.entities.app_invoke_entities import InvokeFrom from core.workflow.entities import GraphRuntimeState from core.workflow.enums import NodeExecutionType -from core.workflow.graph.read_only_state_wrapper import ReadOnlyGraphRuntimeStateWrapper from core.workflow.graph import Graph +from core.workflow.graph.read_only_state_wrapper import ReadOnlyGraphRuntimeStateWrapper from core.workflow.graph_events import ( GraphEngineEvent, GraphNodeEventBase,