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.

refactor(api): deduplicate ImportMode and ImportStatus enums from rag_pipeline_dsl_service (#34759)

Jake Armstrong8f46c9113c3b
diff --git a/api/services/rag_pipeline/rag_pipeline_dsl_service.py b/api/services/rag_pipeline/rag_pipeline_dsl_service.py
index 04156713f4f..e42c0209250 100644
--- a/api/services/rag_pipeline/rag_pipeline_dsl_service.py
+++ b/api/services/rag_pipeline/rag_pipeline_dsl_service.py
@@ -5,7 +5,6 @@ import logging
import uuid
from collections.abc import Mapping
from datetime import UTC, datetime
-from enum import StrEnum
from typing import cast
from urllib.parse import urlparse
from uuid import uuid4
@@ -38,6 +37,7 @@ from models import Account
from models.dataset import Dataset, DatasetCollectionBinding, Pipeline
from models.enums import CollectionBindingType, DatasetRuntimeMode
from models.workflow import Workflow, WorkflowType
+from services.app_dsl_service import ImportMode, ImportStatus
from services.entities.knowledge_entities.rag_pipeline_entities import (
IconInfo,
KnowledgeConfiguration,
@@ -54,18 +54,6 @@ DSL_MAX_SIZE = 10 * 1024 * 1024 # 10MB
CURRENT_DSL_VERSION = "0.1.0"
-class ImportMode(StrEnum):
- YAML_CONTENT = "yaml-content"
- YAML_URL = "yaml-url"
-
-
-class ImportStatus(StrEnum):
- COMPLETED = "completed"
- COMPLETED_WITH_WARNINGS = "completed-with-warnings"
- PENDING = "pending"
- FAILED = "failed"
-
-
class RagPipelineImportInfo(BaseModel):
id: str
status: ImportStatus