mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 17:18:40 +08:00
chore(graph_engine): Move error_strategy.py to protocols/
Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
parent
65617f000d
commit
8129ca7c05
@ -8,7 +8,6 @@ the Strategy pattern for clean separation of concerns.
|
|||||||
from .abort_strategy import AbortStrategy
|
from .abort_strategy import AbortStrategy
|
||||||
from .default_value_strategy import DefaultValueStrategy
|
from .default_value_strategy import DefaultValueStrategy
|
||||||
from .error_handler import ErrorHandler
|
from .error_handler import ErrorHandler
|
||||||
from .error_strategy import ErrorStrategy
|
|
||||||
from .fail_branch_strategy import FailBranchStrategy
|
from .fail_branch_strategy import FailBranchStrategy
|
||||||
from .retry_strategy import RetryStrategy
|
from .retry_strategy import RetryStrategy
|
||||||
|
|
||||||
@ -16,7 +15,6 @@ __all__ = [
|
|||||||
"AbortStrategy",
|
"AbortStrategy",
|
||||||
"DefaultValueStrategy",
|
"DefaultValueStrategy",
|
||||||
"ErrorHandler",
|
"ErrorHandler",
|
||||||
"ErrorStrategy",
|
|
||||||
"FailBranchStrategy",
|
"FailBranchStrategy",
|
||||||
"RetryStrategy",
|
"RetryStrategy",
|
||||||
]
|
]
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
Base error strategy protocol.
|
Base error strategy protocol.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Optional, Protocol
|
from typing import Protocol
|
||||||
|
|
||||||
from core.workflow.graph import Graph
|
from core.workflow.graph import Graph
|
||||||
from core.workflow.graph_events import GraphNodeEventBase, NodeRunFailedEvent
|
from core.workflow.graph_events import GraphNodeEventBase, NodeRunFailedEvent
|
||||||
@ -16,7 +16,7 @@ class ErrorStrategy(Protocol):
|
|||||||
node execution failures.
|
node execution failures.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def handle_error(self, event: NodeRunFailedEvent, graph: Graph, retry_count: int) -> Optional[GraphNodeEventBase]:
|
def handle_error(self, event: NodeRunFailedEvent, graph: Graph, retry_count: int) -> GraphNodeEventBase | None:
|
||||||
"""
|
"""
|
||||||
Handle a node failure event.
|
Handle a node failure event.
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user