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.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
refactor: remove the duplicate definitions across different modules (#9022)
zhuhao959a81a41b2e
diff --git a/api/controllers/files/error.py b/api/controllers/files/error.pynew file mode 100644index 00000000000..a7ce4cd6f79--- /dev/null+++ b/api/controllers/files/error.py@@ -0,0 +1,7 @@+from libs.exception import BaseHTTPException+++class UnsupportedFileTypeError(BaseHTTPException):+ error_code = "unsupported_file_type"+ description = "File type not allowed."+ code = 415diff --git a/api/controllers/files/image_preview.py b/api/controllers/files/image_preview.pyindex 2432285d936..a56c1c332d2 100644--- a/api/controllers/files/image_preview.py+++ b/api/controllers/files/image_preview.py@@ -4,7 +4,7 @@ from werkzeug.exceptions import NotFoundimport servicesfrom controllers.files import api-from libs.exception import BaseHTTPException+from controllers.files.error import UnsupportedFileTypeErrorfrom services.account_service import TenantServicefrom services.file_service import FileService@@ -50,9 +50,3 @@ class WorkspaceWebappLogoApi(Resource):api.add_resource(ImagePreviewApi, "/files/<uuid:file_id>/image-preview")api.add_resource(WorkspaceWebappLogoApi, "/files/workspaces/<uuid:workspace_id>/webapp-logo")---class UnsupportedFileTypeError(BaseHTTPException):- error_code = "unsupported_file_type"- description = "File type not allowed."- code = 415diff --git a/api/controllers/files/tool_files.py b/api/controllers/files/tool_files.pyindex 38ac0815daa..406cd422149 100644--- a/api/controllers/files/tool_files.py+++ b/api/controllers/files/tool_files.py@@ -3,8 +3,8 @@ from flask_restful import Resource, reqparsefrom werkzeug.exceptions import Forbidden, NotFoundfrom controllers.files import api+from controllers.files.error import UnsupportedFileTypeErrorfrom core.tools.tool_file_manager import ToolFileManager-from libs.exception import BaseHTTPExceptionclass ToolFilePreviewApi(Resource):@@ -43,9 +43,3 @@ class ToolFilePreviewApi(Resource):api.add_resource(ToolFilePreviewApi, "/files/tools/<uuid:file_id>.<string:extension>")---class UnsupportedFileTypeError(BaseHTTPException):- error_code = "unsupported_file_type"- description = "File type not allowed."- code = 415