mirror of https://github.com/langgenius/dify.git
chore: code format
Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
parent
657c27ec75
commit
04bbf540d9
|
|
@ -10,7 +10,7 @@ __all__ = [
|
|||
"GraphTemplate",
|
||||
"NodeFactory",
|
||||
"ReadOnlyGraphRuntimeState",
|
||||
"ReadOnlyVariablePool",
|
||||
"ReadOnlyGraphRuntimeStateWrapper",
|
||||
"ReadOnlyVariablePool",
|
||||
"ReadOnlyVariablePoolWrapper",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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)."""
|
||||
...
|
||||
...
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
return self._state.get_output(key, default)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue