mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-15 21:19:39 -05:00
[PR #21294] [MERGED] feat: Enable Rich UI embed support for action functions #129669
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/21294
Author: @Classic298
Created: 2/10/2026
Status: ✅ Merged
Merged: 2/11/2026
Merged by: @tjbck
Base:
dev← Head:claude/verify-dynamic-ui-support-RDHW2📝 Commits (1)
0a08d88Enable Rich UI embed support for action functions📊 Changes
2 files changed (+25 additions, -1 deletions)
View changed files
📝
backend/open_webui/utils/chat.py(+24 -0)📝
backend/open_webui/utils/middleware.py(+1 -1)📄 Description
Action functions can now return HTMLResponse objects or (html, headers) tuples with Content-Disposition: inline to render rich UI iframes in chat, matching the existing tool behavior.
Why?
Actions and Tools are extremely similar - the only difference is who activates them
Tools get activated by LLMs
Actions get activated by Humans
Otherwise they behave the same. They get called on-demand and do something
So they should have the same capabilities and abilities for developers.
If you want to display beautiful graphs and charts with Actions, you have to inject a codeblock with the HTML content into the assistant's message by modifying the body - and even then it is only shown as an Artifact and not as a rich UI embed like the tools have available.
How action authors can now use Rich UI
Option A — HTMLResponse:
Option B — Tuple with headers:
No frontend changes were needed — the socket handler at Chat.svelte:416 already receives "embeds" events generically and renders them via FullHeightIframe.
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.