Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: delete some dead code using vulture (#20999)

yihong909259da373a
diff --git a/api/core/workflow/nodes/event/event.py b/api/core/workflow/nodes/event/event.py
index b72d111f49e..3ebe80f245f 100644
--- a/api/core/workflow/nodes/event/event.py
+++ b/api/core/workflow/nodes/event/event.py
@@ -6,7 +6,6 @@ from pydantic import BaseModel, Field
from core.model_runtime.entities.llm_entities import LLMUsage
from core.rag.entities.citation_metadata import RetrievalSourceMetadata
from core.workflow.entities.node_entities import NodeRunResult
-from core.workflow.entities.workflow_node_execution import WorkflowNodeExecutionStatus
class RunCompletedEvent(BaseModel):
@@ -39,11 +38,3 @@ class RunRetryEvent(BaseModel):
error: str = Field(..., description="error")
retry_index: int = Field(..., description="Retry attempt number")
start_at: datetime = Field(..., description="Retry start time")
-
-
-class SingleStepRetryEvent(NodeRunResult):
- """Single step retry event"""
-
- status: WorkflowNodeExecutionStatus = WorkflowNodeExecutionStatus.RETRY
-
- elapsed_time: float = Field(..., description="elapsed time")
diff --git a/api/factories/variable_factory.py b/api/factories/variable_factory.py
index fa8a90e79ff..a41ef4ae4ec 100644
--- a/api/factories/variable_factory.py
+++ b/api/factories/variable_factory.py
@@ -39,10 +39,6 @@ from core.variables.variables import (
from core.workflow.constants import CONVERSATION_VARIABLE_NODE_ID, ENVIRONMENT_VARIABLE_NODE_ID
-class InvalidSelectorError(ValueError):
- pass
-
-
class UnsupportedSegmentTypeError(Exception):
pass
diff --git a/api/services/errors/__init__.py b/api/services/errors/__init__.py
index eb1f055708c..697e691224c 100644
--- a/api/services/errors/__init__.py
+++ b/api/services/errors/__init__.py
@@ -4,7 +4,6 @@ from . import (
app_model_config,
audio,
base,
- completion,
conversation,
dataset,
document,
@@ -19,7 +18,6 @@ __all__ = [
"app_model_config",
"audio",
"base",
- "completion",
"conversation",
"dataset",
"document",
diff --git a/api/services/errors/account.py b/api/services/errors/account.py
index 5aca12ffeb9..4d3d150e072 100644
--- a/api/services/errors/account.py
+++ b/api/services/errors/account.py
@@ -55,7 +55,3 @@ class MemberNotInTenantError(BaseServiceError):
class RoleAlreadyAssignedError(BaseServiceError):
pass
-
-
-class RateLimitExceededError(BaseServiceError):
- pass
diff --git a/api/services/errors/completion.py b/api/services/errors/completion.py
deleted file mode 100644
index 7fc50a588e6..00000000000
--- a/api/services/errors/completion.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from services.errors.base import BaseServiceError
-
-
-class CompletionStoppedError(BaseServiceError):
- pass