mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
r2
This commit is contained in:
@ -41,6 +41,7 @@ from models.workflow import (
|
||||
from services.entities.knowledge_entities.rag_pipeline_entities import PipelineTemplateInfoEntity
|
||||
from services.errors.app import WorkflowHashNotEqualError
|
||||
from services.rag_pipeline.pipeline_template.pipeline_template_factory import PipelineTemplateRetrievalFactory
|
||||
from services.rag_pipeline.rag_pipeline_dsl_service import RagPipelineDslService
|
||||
|
||||
|
||||
class RagPipelineService:
|
||||
@ -115,6 +116,20 @@ class RagPipelineService:
|
||||
db.delete(customized_template)
|
||||
db.commit()
|
||||
|
||||
@classmethod
|
||||
def export_template_rag_pipeline_dsl(cls, template_id: str) -> str:
|
||||
"""
|
||||
Export template rag pipeline dsl
|
||||
"""
|
||||
template = db.session.query(PipelineCustomizedTemplate).filter(PipelineCustomizedTemplate.id == template_id).first()
|
||||
if not template:
|
||||
raise ValueError("Customized pipeline template not found.")
|
||||
pipeline = db.session.query(Pipeline).filter(Pipeline.id == template.pipeline_id).first()
|
||||
if not pipeline:
|
||||
raise ValueError("Pipeline not found.")
|
||||
|
||||
return RagPipelineDslService.export_rag_pipeline_dsl(pipeline, include_secret=True)
|
||||
|
||||
def get_draft_workflow(self, pipeline: Pipeline) -> Optional[Workflow]:
|
||||
"""
|
||||
Get draft workflow
|
||||
|
||||
Reference in New Issue
Block a user