mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[GH-ISSUE #24641] feat: Feature Request: Support File Download in Custom Tools within Chat Conversation #91108
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DannielZhang on GitHub (May 13, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24641
Check Existing Issues
Verify Feature Scope
Problem Description
I am developing custom Python tools for Open WebUI and need the tools to generate files (e.g., CSV, JSON, TXT, PDF, Excel) and make them directly downloadable in the chat interface. Currently, there is no clear, official, and stable implementation standard for custom tools to return downloadable files to users—existing workarounds (e.g., files structure, event_emitter, writing to UPLOAD_DIR) lack consistent behavior and official documentation, leading to unstable user experiences.
Desired Solution you'd like
Provide an official, documented standard for custom tools to return files: The tool should output a structured response that the Open WebUI frontend can automatically parse into a downloadable attachment (with a clear download button).
Support multiple file sources: Allow tools to return base64-encoded file content (for small files) or reference file paths/URLs (for large files/streamed content).
Ensure cross-version stability: The implementation should be backward-compatible and not break existing tool workflows.
Add official examples: Include sample code for common use cases (e.g., generating CSV reports, exporting JSON data) in the Open WebUI docs.
Alternatives Considered
Returning a files array in the tool's response dictionary (inconsistent frontend rendering across versions).
Using event_emitter to push file events to the chat (complex for synchronous tools, limited documentation).
Writing files directly to Open WebUI's UPLOAD_DIR (permission issues in Docker environments, unclear URL routing rules).
Additional Context
A standardized file download mechanism for custom tools would significantly enhance Open WebUI's extensibility, enabling more practical tool use cases (e.g., data export, report generation, document creation). Clear documentation and stable APIs will reduce developer friction when building custom tools.
Use case
@owui-terminator[bot] commented on GitHub (May 13, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
🟣 #13368 issue: Files from tool servers are ignored
This issue reports that binary/file outputs from tool servers are currently dropped, which is directly related to the new request for a standard way for tools to return downloadable files. It shows the same underlying gap in tool-response file handling.
by timsomers ·
bug🟣 #2014 Add File Generation
This is an earlier feature request for generating documents such as PDF/DOCX and downloading them from chat. It overlaps closely with the new request’s goal of letting tools create downloadable files in the conversation.
by Razikale365
🟣 #1612 feat: ability to download answers in table format as an Excel or CSV file.
This asks for downloading LLM answers as Excel or CSV files, which is a narrower version of the same export/download capability requested for custom tools. It is relevant because it reflects the same user need for downloadable tabular output.
by Taehui
🟣 #23841 issue: fetch_url tool call returns PDF files in binary, overwhelming most models
Although this issue is about PDF content being returned as raw binary in a tool call, it highlights the same general problem of improper file/binary handling in tool responses. It is related because the new feature request seeks a stable mechanism for file outputs from tools.
by Davimalu ·
bug💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.
@Classic298 commented on GitHub (May 13, 2026):
if you want docs improvements, please open in docs repo not here thanks
i would think about uploading it to the files api endpoint and then giving the AI back the link and telling it, it should embed it into the chat as clickable markdown