mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 06:03:26 -05:00
[PR #15087] [CLOSED] feat: Task model message truncation #10507
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/15087
Author: @Classic298
Created: 6/17/2025
Status: ❌ Closed
Base:
dev← Head:task-model-message-truncation📝 Commits (8)
ed1cc54Update config.py5504af8Update env.pyf0f8a2aUpdate main.py8872182Update tasks.py47ff3f9Update task.py09447f2Update Interface.sveltee4763b2Update env.pybd0d4afUpdate Interface.svelte📊 Changes
5 files changed (+84 additions, -30 deletions)
View changed files
📝
backend/open_webui/config.py(+6 -0)📝
backend/open_webui/main.py(+3 -0)📝
backend/open_webui/routers/tasks.py(+4 -0)📝
backend/open_webui/utils/task.py(+50 -29)📝
src/lib/components/admin/Settings/Interface.svelte(+21 -1)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Adds a new setting in Interface.svelte underneath task model selector, to allow set a max amount of characters to be used per retrieved message for each task model prompt.
This can save on excessive task model costs.
A value like 10000 could be more than enough for 99% of cases while still saving on excess costs for very long messages.
Note: setting a value for the character truncation applies to all task model prompts that make use of the message fetching functionality of the current conversation i.e. for generating a title or a tag or the follow up queries, but also the web search queries.
So it is advisable to not use values too short, otherwise important context might be going missing to generate useful web search queries or follow up prompts.
The default value is -1, to reflect current behaviour and have no unintended new effects to users upgrading to a new Open WebUI version where this feature would potentially be introduced - to ensure current behaviour remains unchanged.
Docs: https://github.com/open-webui/docs/pull/585
Screenshots or Videos
Admin Panel:
Description when hovering over input field
Placeholder
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.