diff --git a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py index 139a46e0f5..81e344250d 100644 --- a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py +++ b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py @@ -968,7 +968,10 @@ class RagPipelineDatasourceVariableApi(Resource): ) return workflow_node_execution + from flask_restx import reqparse + + @console_ns.route("/rag/pipelines/recommended-plugins") class RagPipelineRecommendedPluginApi(Resource): @setup_required @@ -976,7 +979,7 @@ class RagPipelineRecommendedPluginApi(Resource): @account_initialization_required def get(self): parser = reqparse.RequestParser() - parser.add_argument('type', type=str, location='args', required=False, default='all') + parser.add_argument("type", type=str, location="args", required=False, default="all") args = parser.parse_args() type = args["type"] diff --git a/api/services/rag_pipeline/rag_pipeline.py b/api/services/rag_pipeline/rag_pipeline.py index 3065651c9d..f53448e7fe 100644 --- a/api/services/rag_pipeline/rag_pipeline.py +++ b/api/services/rag_pipeline/rag_pipeline.py @@ -1254,10 +1254,7 @@ class RagPipelineService: if type and type != "all": query = query.where(PipelineRecommendedPlugin.type == type) - pipeline_recommended_plugins = ( - query.order_by(PipelineRecommendedPlugin.position.asc()) - .all() - ) + pipeline_recommended_plugins = query.order_by(PipelineRecommendedPlugin.position.asc()).all() if not pipeline_recommended_plugins: return {