mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[PR #23189] [CLOSED] feat: support additional Anthropic tool_result content types #65926
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/23189
Author: @Classic298
Created: 3/28/2026
Status: ❌ Closed
Base:
dev← Head:anthropic📝 Commits (4)
4b9443bUpdate anthropic.py93186baUpdate main.py5ac3930fix: strict image source validation, catch all conversion errors as 4008768a90fix: validate required image fields, narrow exception catch to preserve 500s for real bugs📊 Changes
2 files changed (+97 additions, -29 deletions)
View changed files
📝
backend/open_webui/main.py(+5 -1)📝
backend/open_webui/utils/anthropic.py(+92 -28)📄 Description
Adds support for images and string content in Anthropic tool_result blocks, and explicit errors for unsupported types (search_result, document).
Images use the existing input_text/input_image multimodal tool message pattern from utils/misc.py, which the middleware already handles for downstream providers.
Also extracts a _convert_anthropic_image_source helper to DRY up image conversion, and adds HTTP 400 error handling for conversion failures.
Based on the work in #23004 by @regulad.
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.