mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 23:21:44 -05:00
[PR #22691] [CLOSED] feat: Allow HTML responses from tool results to include a custom message #81687
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/22691
Author: @Haervwe
Created: 3/15/2026
Status: ❌ Closed
Base:
dev← Head:feat/custom-tool-result-message📝 Commits (2)
e3ff763feat: allow tools to return (HTMLResponse, message) tuple for custom LLM context7d830b9Merge branch 'dev' into feat/custom-tool-result-message📊 Changes
1 file changed (+10 additions, -3 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+10 -3)📄 Description
Pull Request Checklist
devbranch. PRs targetingmainwill be immediately closed.devto ensure no unrelated commits (e.g. frommain) are included. Push updates to the existing PR branch instead of closing and reopening.Changelog Entry
Description
HTMLResponseor the tuple [(html, headers)] replaces the tool's actual return value with a hardcoded message:"{tool_function_name}: Embedded UI result is active and visible to the user."This prevents tool authors from providing the LLM with specific context about the generated embed (e.g., parameters used, status, what was actually generated). This PR introduces support for an optional tuple (HTMLReturn, str | dict | list) that allows authors to override this generic message with the tuples second member, providing the LLM with actionable context while still rendering the embedded UI to the user.
See discussion:
Added
Changed
Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Screenshots or Videos
Test on wheather tool
The LLM can call the tool show the embed and get a helpfull message on tool output for itself for future refereces in the chat
documentation updated in PR :
https://github.com/open-webui/docs/pull/1140
for the changes
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.