37d1c85 Merge pull request #17827 from open-webui/dev
4d7fdda Merge pull request #17892 from open-webui/dev
0a928d6 Tool 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:
Target branch: Please verify that the pull request targets the dev branch.
Description: Provide a concise description of the changes made in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
Testing: Have you written and run sufficient tests to validate the changes?
Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
BREAKING CHANGE: Significant changes that may affect compatibility
build: Changes that affect the build system or external dependencies
ci: Changes to our continuous integration processes or workflows
chore: Refactor, cleanup, or other non-functional code changes
docs: Documentation update or addition
feat: Introduces a new feature or enhancement to the codebase
fix: Bug fix or error correction
i18n: Internationalization or localization changes
perf: Performance improvement
refactor: Code restructuring for better maintainability, readability, or scalability
style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
test: Adding missing tests or correcting existing tests
WIP: Work in progress, a temporary label for incomplete or ongoing work
Changelog Entry
Optimized task model function calling performance by excluding base64 image data from payloads, now only processing text content from messages with mixed content types.
Description
Optimized task model payload for function calling by excluding base64 image data
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
Performance issue with large base64 image data in task model requests
Task model function calling now only processes text content instead of including entire image base64 strings
Reduced memory usage and network overhead for function calling operations
Improved response times when images are attached to messages
Additional Information
Technical Details: The change affects the get_tools_function_calling_payload function in middleware.py where get_content_from_message is 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.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/17897
**Author:** [@jmleksan](https://github.com/jmleksan)
**Created:** 9/29/2025
**Status:** ✅ Merged
**Merged:** 9/30/2025
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `fix/tool-task-only-include-text`
---
### 📝 Commits (3)
- [`37d1c85`](https://github.com/open-webui/open-webui/commit/37d1c85c996e1bdcd505e1e6d62b2f17acd8df23) Merge pull request #17827 from open-webui/dev
- [`4d7fdda`](https://github.com/open-webui/open-webui/commit/4d7fddaf7e434bf59fdd879ef11d712a503b7863) Merge pull request #17892 from open-webui/dev
- [`0a928d6`](https://github.com/open-webui/open-webui/commit/0a928d6e9d0036bbfadc58729e72b4d2dabf5bdb) Tool calls now only include text and dont inlcude other content like image b64
### 📊 Changes
**1 file changed** (+2 additions, -1 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/utils/middleware.py` (+2 -1)
</details>
### 📄 Description
# Pull Request Checklist
**Before submitting, make sure you've checked the following:**
- [x] **Target branch:** Please verify that the pull request targets the `dev` branch.
- [x] **Description:** Provide a concise description of the changes made in this pull request.
- [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
- [x] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources?
- [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
- [x] **Testing:** Have you written and run sufficient tests to validate the changes?
- [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
- [x] **Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following:
- **BREAKING CHANGE**: Significant changes that may affect compatibility
- **build**: Changes that affect the build system or external dependencies
- **ci**: Changes to our continuous integration processes or workflows
- **chore**: Refactor, cleanup, or other non-functional code changes
- **docs**: Documentation update or addition
- **feat**: Introduces a new feature or enhancement to the codebase
- **fix**: Bug fix or error correction
- **i18n**: Internationalization or localization changes
- **perf**: Performance improvement
- **refactor**: Code restructuring for better maintainability, readability, or scalability
- **style**: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
- **test**: Adding missing tests or correcting existing tests
- **WIP**: Work in progress, a temporary label for incomplete or ongoing work
# Changelog Entry
- Optimized task model function calling performance by excluding base64 image data from payloads, now only processing text content from messages with mixed content types.
### Description
- **Optimized task model payload for function calling by excluding base64 image data**
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
- **Performance issue with large base64 image data in task model requests**
- Task model function calling now only processes text content instead of including entire image base64 strings
- Reduced memory usage and network overhead for function calling operations
- Improved response times when images are attached to messages
---
### Additional Information
- **Technical Details**: The change affects the `get_tools_function_calling_payload` function in `middleware.py` where `get_content_from_message` is 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)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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.