mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #17897] [MERGED] Fix: Tool task only include text #63449
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/17897
Author: @jmleksan
Created: 9/29/2025
Status: ✅ Merged
Merged: 9/30/2025
Merged by: @tjbck
Base:
dev← Head:fix/tool-task-only-include-text📝 Commits (3)
37d1c85Merge pull request #17827 from open-webui/dev4d7fddaMerge pull request #17892 from open-webui/dev0a928d6Tool calls now only include text and dont inlcude other content like image b64📊 Changes
1 file changed (+2 additions, -1 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+2 -1)📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Previously, when the task model was called for function calling, it would include the entire message content including full base64-encoded image data. This inclusion would drastically increase token count and sometimes stop the task request due to too high context. This change modifies the `get_tools_function_calling_payload' function to use 'get_content_from_message' which only extracts text content from messages, significantly reducing payload size and improving performance when images are present in the conversation.
Fixed
Additional Information
Technical Details: The change affects the
get_tools_function_calling_payloadfunction inmiddleware.pywhereget_content_from_messageis used to extract content from chat history. This function now only returns text content from messages with mixed content (text + images), excluding the base64 image data.Potential Future Enhancement: Consider adding a
[image]placeholder in the task model prompt to indicate when an image is attached to a message, allowing the task model to be aware of image presence without processing the actual image data. This would maintain context while preserving the performance benefits.Impact: This change improves the efficiency of function calling operations, especially in conversations with multiple images, without affecting the core functionality of the task model or tool execution.
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.