mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #21394] [CLOSED] feat: support arbitrary file output from Jupyter code execution #26065
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21394
Author: @lewisco
Created: 2/13/2026
Status: ❌ Closed
Base:
main← Head:feat/jupyter-generic-file-output📝 Commits (1)
3151992feat: support arbitrary file output from Jupyter code execution📊 Changes
5 files changed (+343 additions, -71 deletions)
View changed files
📝
backend/open_webui/tools/builtin.py(+84 -32)📝
backend/open_webui/utils/code_interpreter.py(+124 -4)📝
backend/open_webui/utils/files.py(+76 -2)📝
backend/open_webui/utils/middleware.py(+58 -32)📝
src/lib/components/chat/Messages/ResponseMessage.svelte(+1 -1)📄 Description
Summary
image/pngoutputs only. Skills that generate documents (PPTX, PDF, XLSX, CSV, etc.) had no way to deliver files to userschat:message:filesevent pattern (same asgenerate_image)Changes across 5 files:
code_interpreter.py— Capture anyimage/*,application/*,audio/*MIME type from Jupyter. Add preamble/postamble that creates a writable data dir, scans for new files after execution, and emits them asdisplay_datawith correct MIME types and original filenamesfiles.py— Add genericupload_file_from_base64()andget_file_url_from_base64()that handle any data URI MIME type. Register common office MIME types. Support embeddedfilenameparameter in data URIsbuiltin.py— Replace image-only scanning inexecute_codewith generic data URI detection. Images render inline; non-image files emitted aschat:message:filesattachments with DB persistencemiddleware.py— Apply same generic handling to the native (non-tool) code interpreter pathResponseMessage.svelte— Change file display gate fromfilter(f => f.type === 'image')to show all file types (the inner{#each}already dispatches to<Image>vs<FileItem>)How it works
.pptx) to__owui_data_dir(set by the preamble)display_datawith the correct MIME typecode_interpreter.pycaptures the base64 data with MIME type and original filenamebuiltin.pyuploads viaget_file_url_from_base64()and emits as a chat file attachment<FileItem>Test plan
CODE_INTERPRETER_ENGINE=jupyterwith an external Jupyter server.pptxfile usingpython-pptx— verify it appears as a downloadable attachment in the chatdata:application/pdf;base64,...) and CSV outputgenerated-file.pptx)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.