mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-11 00:04:08 -05:00
[PR #2979] [CLOSED] feat:Add dialog rounds strategy to limit messages submited to backend #7943
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/2979
Author: @fxsome
Created: 6/10/2024
Status: ❌ Closed
Base:
dev← Head:dialog_rounds_strategy📝 Commits (4)
96a004dMerge pull request #2921 from open-webui/dev8947da5Merge pull request #2966 from open-webui/dev75d455aMerge pull request #2967 from open-webui/deva168562Added the ability to config dialog rounds strategy📊 Changes
3 files changed (+94 additions, -3 deletions)
View changed files
📝
src/lib/components/chat/Chat.svelte(+26 -3)📝
src/lib/components/chat/Settings/Chats.svelte(+65 -0)📝
src/lib/stores/index.ts(+3 -0)📄 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
Limit dialog rounds, provide several strategy , ONLY FOR sendPromptOpenAI . I have no Ollama environment to test the code, so I leave as is, not touch it. The interface is in the settings-----chats. A test video is attached below. No new dependencies needed
add four ways to submit dialog to backend:
1,no limit;
2,First N rounds and most recent user message
3,System prompt , first user message and latest N rounds
4,only recent N rounds
I modied 3 files :
src\lib\stores\index.ts add 2 local parameters
src\lib\components\chat\Settings\Chats.svelte deal with the interface to modify the 2 parameters.
src\lib\components\chat\Chat.svelte using getMessagesByStrategy method to apply strategy and apply only in sendPromptOpenAI method
Added
src\lib\stores\index.ts add 2 local parameters
src\lib\components\chat\Settings\Chats.svelte deal with the interface to modify the 2 parameters.
src\lib\components\chat\Chat.svelte using getMessagesByStrategy method to apply strategy and apply only in
sendPromptOpenAI** method
Screenshots or Videos
a test video is submited
https://github.com/open-webui/open-webui/assets/44434587/dc751ed6-fb06-4b48-80f5-bb4713453242
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.