mirror of
https://github.com/langgenius/dify.git
synced 2026-03-25 16:28:04 +08:00
- Migrate core.model_runtime -> dify_graph.model_runtime across 20+ files - Migrate core.workflow.file -> dify_graph.file across 15+ files - Migrate core.workflow.enums -> dify_graph.enums in service files - Fix SandboxContext phantom import in dify_graph/context/__init__.py - Fix core.app.workflow.node_factory -> core.workflow.node_factory - Fix toast import paths (useToastContext from toast/context) - Fix app-info.tsx import paths for relocated app-operations - Fix 15 frontend test files for API changes, missing QueryClientProvider, i18n key renames, and component behavior changes Made-with: Cursor
24 lines
577 B
Python
24 lines
577 B
Python
import logging
|
|
|
|
from dify_graph.graph_engine.layers.base import GraphEngineLayer
|
|
from dify_graph.graph_events.base import GraphEngineEvent
|
|
|
|
from core.sandbox import Sandbox
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class SandboxLayer(GraphEngineLayer):
|
|
def __init__(self, sandbox: Sandbox) -> None:
|
|
super().__init__()
|
|
self._sandbox = sandbox
|
|
|
|
def on_graph_start(self) -> None:
|
|
pass
|
|
|
|
def on_event(self, event: GraphEngineEvent) -> None:
|
|
pass
|
|
|
|
def on_graph_end(self, error: Exception | None) -> None:
|
|
self._sandbox.release()
|