[PR #15087] [CLOSED] feat: Task model message truncation #10507

Closed
opened 2025-11-11 19:06:41 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/15087
Author: @Classic298
Created: 6/17/2025
Status: Closed

Base: devHead: task-model-message-truncation


📝 Commits (8)

📊 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:

  • 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? https://github.com/open-webui/docs/pull/585
  • 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:
    • feat: Introduces a new feature or enhancement to the codebase

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

image

image

image

image

Admin Panel:

image

Description when hovering over input field

image

Placeholder

image

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/15087 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 6/17/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `task-model-message-truncation` --- ### 📝 Commits (8) - [`ed1cc54`](https://github.com/open-webui/open-webui/commit/ed1cc5497b9be345b2e2c5d3a5031bce76b3f947) Update config.py - [`5504af8`](https://github.com/open-webui/open-webui/commit/5504af8c6a4390004e557a4a6f60b6e433617359) Update env.py - [`f0f8a2a`](https://github.com/open-webui/open-webui/commit/f0f8a2a775eda9919401c4ff41a36f1436b1cda6) Update main.py - [`8872182`](https://github.com/open-webui/open-webui/commit/88721827bb676c99368fcf209465fea2b8cdc152) Update tasks.py - [`47ff3f9`](https://github.com/open-webui/open-webui/commit/47ff3f90f2f6cc53fdecdc49ae9139f4319d265f) Update task.py - [`09447f2`](https://github.com/open-webui/open-webui/commit/09447f2c550cd44a90a1c6ca016f073c2fd485ff) Update Interface.svelte - [`e4763b2`](https://github.com/open-webui/open-webui/commit/e4763b258e9f1f015df45393b4a447b3cfa75dea) Update env.py - [`bd0d4af`](https://github.com/open-webui/open-webui/commit/bd0d4afc6510bc47dc5037a64d69e5319b197438) Update Interface.svelte ### 📊 Changes **5 files changed** (+84 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `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) </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request. **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. - [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? https://github.com/open-webui/docs/pull/585 - [ ] **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: - **feat**: Introduces a new feature or enhancement to the codebase # Changelog Entry ### Description - Fixes: https://github.com/open-webui/open-webui/issues/15081#issuecomment-2981157634 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 ![image](https://github.com/user-attachments/assets/25833a1c-be6f-49f5-b2bf-c49773edc195) ![image](https://github.com/user-attachments/assets/36b4fbb1-af26-448f-b8ff-445220154ebf) ![image](https://github.com/user-attachments/assets/3ab06053-6a03-4d41-a783-e3c65f0034b7) ![image](https://github.com/user-attachments/assets/59e33182-759b-4cd4-ab59-8a26ecce676e) Admin Panel: ![image](https://github.com/user-attachments/assets/3305242c-6b36-415c-af30-d0b169af1b27) Description when hovering over input field ![image](https://github.com/user-attachments/assets/288e1396-1198-4544-b85c-6d3177d308dd) Placeholder ![image](https://github.com/user-attachments/assets/c6eb8fd0-395a-4506-8e8f-d035852a7d5c) ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](/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>
GiteaMirror added the pull-request label 2025-11-11 19:06:41 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#10507