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
fix: support non-ascii charactors in filename of the tool files (#19228)
Bowen Liang22f5af9987c4
diff --git a/api/controllers/files/tool_files.py b/api/controllers/files/tool_files.pyindex 7cb97806c87..2779514bed7 100644--- a/api/controllers/files/tool_files.py+++ b/api/controllers/files/tool_files.py@@ -1,3 +1,5 @@+from urllib.parse import quote+from flask import Responsefrom flask_restful import Resource, reqparse # type: ignorefrom werkzeug.exceptions import Forbidden, NotFound@@ -46,7 +48,8 @@ class ToolFilePreviewApi(Resource):if tool_file.size > 0:response.headers["Content-Length"] = str(tool_file.size)if args["as_attachment"]:- response.headers["Content-Disposition"] = f"attachment; filename={tool_file.name}"+ encoded_filename = quote(tool_file.name)+ response.headers["Content-Disposition"] = f"attachment; filename*=UTF-8''{encoded_filename}"return responsediff --git a/api/core/tools/tool_file_manager.py b/api/core/tools/tool_file_manager.pyindex c60e4f4e4ab..b849f510648 100644--- a/api/core/tools/tool_file_manager.py+++ b/api/core/tools/tool_file_manager.py@@ -4,6 +4,7 @@ import hmacimport loggingimport osimport time+from collections.abc import Generatorfrom mimetypes import guess_extension, guess_typefrom typing import Optional, Unionfrom uuid import uuid4@@ -215,7 +216,7 @@ class ToolFileManager:return blob, tool_file.mimetype- def get_file_generator_by_tool_file_id(self, tool_file_id: str):+ def get_file_generator_by_tool_file_id(self, tool_file_id: str) -> tuple[Optional[Generator], Optional[ToolFile]]:"""get file binary