mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-25 04:24:30 -05:00
issue: Files from tool servers are ignored #5002
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 @timsomers on GitHub (Apr 30, 2025).
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
0.6.5
Ollama Version (if applicable)
No response
Operating System
Debian (wsl)
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Binary data coming from an openapi tool server is included (as a file?) in the conversation.
Actual Behavior
The binary data gets silently dropped, only text data is used.
Steps to Reproduce
Set up an openapi server that returns a "List[EMail | str]" type. The EMail model is not relevant here as these get properly included, but mail attachments are string encoded using the "data:image/png;base64,..." url scheme. The server responds with a mix of EMails and str's, which all start with "data:". I found that the returned data gets processed in https://github.com/open-webui/open-webui/blob/main/backend/open_webui/utils/middleware.py
In line 226 had to change "tool_result" to "tool_result[:]" to work with a copy of the list, as this causes issues once items get removed on line 230. Once this is done, the original mix of mails and attachments gets properly split into mails only in tool_result, and the attachments in tool_result_files. After that, tool_result_files gets ignored completely, only the email text gets returned for use.
Logs & Screenshots
not relevant
Additional Information
This looks like a feature that's just not finished yet. Is this currently being worked on? Would it be as simple as doing the equivalent of uploading an image at https://github.com/open-webui/open-webui/blob/main/backend/open_webui/routers/images.py#L453 and then adding it to body["metadata"]["files"] ?
@tjbck commented on GitHub (May 26, 2025):
Could you share your tool server with us so we can attempt to reproduce/support?