From 101d6504fbd48d4b38f8eebfeff975bdc29e47e5 Mon Sep 17 00:00:00 2001 From: jyong <718720800@qq.com> Date: Mon, 25 Aug 2025 16:14:22 +0800 Subject: [PATCH] fix --- .../console/datasets/rag_pipeline/datasource_auth.py | 7 ++----- .../datasets/rag_pipeline/datasource_content_preview.py | 2 +- .../console/datasets/rag_pipeline/rag_pipeline.py | 2 +- .../console/datasets/rag_pipeline/rag_pipeline_datasets.py | 2 +- .../datasets/rag_pipeline/rag_pipeline_draft_variable.py | 2 +- .../console/datasets/rag_pipeline/rag_pipeline_import.py | 2 +- .../console/datasets/rag_pipeline/rag_pipeline_workflow.py | 4 ++-- api/core/app/entities/app_invoke_entities.py | 4 ++-- api/fields/rag_pipeline_fields.py | 2 +- 9 files changed, 12 insertions(+), 15 deletions(-) diff --git a/api/controllers/console/datasets/rag_pipeline/datasource_auth.py b/api/controllers/console/datasets/rag_pipeline/datasource_auth.py index 3cf29a729c..a307ca0945 100644 --- a/api/controllers/console/datasets/rag_pipeline/datasource_auth.py +++ b/api/controllers/console/datasets/rag_pipeline/datasource_auth.py @@ -1,10 +1,7 @@ from fastapi.encoders import jsonable_encoder from flask import make_response, redirect, request -from flask_login import current_user # type: ignore -from flask_restful import ( # type: ignore - Resource, # type: ignore - reqparse, -) +from flask_login import current_user +from flask_restx import Resource, reqparse from werkzeug.exceptions import Forbidden, NotFound from configs import dify_config diff --git a/api/controllers/console/datasets/rag_pipeline/datasource_content_preview.py b/api/controllers/console/datasets/rag_pipeline/datasource_content_preview.py index af114e09db..05fa681a33 100644 --- a/api/controllers/console/datasets/rag_pipeline/datasource_content_preview.py +++ b/api/controllers/console/datasets/rag_pipeline/datasource_content_preview.py @@ -1,4 +1,4 @@ -from flask_restful import ( # type: ignore +from flask_restx import ( # type: ignore Resource, # type: ignore reqparse, ) diff --git a/api/controllers/console/datasets/rag_pipeline/rag_pipeline.py b/api/controllers/console/datasets/rag_pipeline/rag_pipeline.py index 334c11bddb..e6360706ee 100644 --- a/api/controllers/console/datasets/rag_pipeline/rag_pipeline.py +++ b/api/controllers/console/datasets/rag_pipeline/rag_pipeline.py @@ -1,7 +1,7 @@ import logging from flask import request -from flask_restful import Resource, reqparse +from flask_restx import Resource, reqparse from sqlalchemy.orm import Session from controllers.console import api diff --git a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_datasets.py b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_datasets.py index 3a9ebd6717..ebbd7d317b 100644 --- a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_datasets.py +++ b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_datasets.py @@ -1,5 +1,5 @@ from flask_login import current_user # type: ignore # type: ignore -from flask_restful import Resource, marshal, reqparse # type: ignore +from flask_restx import Resource, marshal, reqparse # type: ignore from werkzeug.exceptions import Forbidden import services diff --git a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_draft_variable.py b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_draft_variable.py index 4decf0f627..18cfac4fd8 100644 --- a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_draft_variable.py +++ b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_draft_variable.py @@ -2,7 +2,7 @@ import logging from typing import Any, NoReturn from flask import Response -from flask_restful import Resource, fields, inputs, marshal, marshal_with, reqparse +from flask_restx import Resource, fields, inputs, marshal, marshal_with, reqparse from sqlalchemy.orm import Session from werkzeug.exceptions import Forbidden diff --git a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_import.py b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_import.py index 485a73e517..22b3100d44 100644 --- a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_import.py +++ b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_import.py @@ -1,7 +1,7 @@ from typing import cast from flask_login import current_user # type: ignore -from flask_restful import Resource, marshal_with, reqparse # type: ignore +from flask_restx import Resource, marshal_with, reqparse # type: ignore from sqlalchemy.orm import Session from werkzeug.exceptions import Forbidden 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 ea1114cbe0..cf4baadb1d 100644 --- a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py +++ b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py @@ -3,8 +3,8 @@ import logging from typing import cast from flask import abort, request -from flask_restful import Resource, inputs, marshal_with, reqparse # type: ignore # type: ignore -from flask_restful.inputs import int_range # type: ignore +from flask_restx import Resource, inputs, marshal_with, reqparse # type: ignore # type: ignore +from flask_restx.inputs import int_range # type: ignore from sqlalchemy.orm import Session from werkzeug.exceptions import Forbidden, InternalServerError, NotFound diff --git a/api/core/app/entities/app_invoke_entities.py b/api/core/app/entities/app_invoke_entities.py index 1550631069..0e27c22861 100644 --- a/api/core/app/entities/app_invoke_entities.py +++ b/api/core/app/entities/app_invoke_entities.py @@ -1,5 +1,5 @@ from collections.abc import Mapping, Sequence -from enum import Enum +from enum import Enum, StrEnum from typing import Any, Optional from pydantic import BaseModel, ConfigDict, Field, ValidationInfo, field_validator @@ -11,7 +11,7 @@ from core.file import File, FileUploadConfig from core.model_runtime.entities.model_entities import AIModelEntity -class InvokeFrom(Enum): +class InvokeFrom(StrEnum): """ Invoke From. """ diff --git a/api/fields/rag_pipeline_fields.py b/api/fields/rag_pipeline_fields.py index cedc13ed0d..f9e858c68b 100644 --- a/api/fields/rag_pipeline_fields.py +++ b/api/fields/rag_pipeline_fields.py @@ -1,4 +1,4 @@ -from flask_restful import fields # type: ignore +from flask_restx import fields # type: ignore from fields.workflow_fields import workflow_partial_fields from libs.helper import AppIconUrlField, TimestampField