mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
Allow filter outlets to trigger continuation automatically #1787
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?
Originally created by @rndmcnlly on GitHub (Aug 15, 2024).
Originally assigned to: @tjbck on GitHub.
Is your feature request related to a problem? Please describe.
A model cannot react to the result of a filter outlet's effect until the user's next query. This inhibits the development of certain useful interaction patterns sketched below.
Describe the solution you'd like
In a filter's outlet, I'd like to be able to say
body["continue"] = True. This should have a similar effect to as if the user had decided to press existing "Continue Response" button in the UI. Rather than appending content to the previous message, however, it should start the flow for generating a new message. It should be possible for this process to be chained several times (e.g. the continued response, upon being examined by a filter outline, gets the continue flag set again).(I have some ideas for safety features that would break potential infinite auto-continue loops, but perhaps we can save those until problems arise in practice. The UI's existing "Stop" button should be sufficient for for most cases.)
Describe alternatives you've considered
Here's my current workaround within the current OWUI design: My filter outlet programmatically inserts text like (1) "Say anything to continue the conversation." or (2) "Press the 'Continue Response' button to continue the conversation." The first option requires the user to make up some useless response (usually "okay", "sure", "k", "get on with it!"), and the second option requires them to switch from typing to UI button clicking and back. Beyond disrupting the conversational flow, this solution isn't responsive to the conversation context. For example, if the conversation had recently been proceeding in the Spanish language, it is jarring to read the English text injected by my Python code.
Compared to this workaround, an auto-continue mechanism would allow the assistant to remain in-character and avoid requiring the user to take a distracting action just to kick the conversation along.
Additional context
Here are some use-cases for this feature:
body["continue"] = True.asyncio.sleep(60)or whatever to stall the response flow. It could be based on any await-able expression, not just time.body["messages"].I prototyped a mechanism somewhat like this in the ChatGPT interface a few months ago. I created a small local browser extension (based on Tampermonkey) that would inject a user message like "The time is now {time}." every 10 seconds. By default, ChatGPT replies something like "Thanks for the update. How can I help you?" However, if the context of the conversation so far included messages like "Remind me to check on the pie in the oven in 5 minutes." then some of these replies would look like "It looks like 5 minutes have passed. You should check the pie now." This was fun to play with, but the polling-based design was expensive (many messages sent when no action was needed) and imprecise (only 10-second granularity to timing). The design I've sketched in this feature request could allow extremely precise timing (based on whenever an
awaitcompletes) and efficient (no extra messages during idle times).tl;dr: An auto-continue mechanism triggered by setting
body["continue"] = Truein a filter's outlet could be extremely powerful.@tjbck commented on GitHub (Aug 15, 2024):
This would be a great addition for
__event_emitter__, will be added soon.@rndmcnlly commented on GitHub (Aug 15, 2024):
Having the behavior triggered via
__event_emitter__sounds like an excellent design!Concretely, I'm imagining you'd use it like
I had an idea like that at an earlier stage, but I dropped it because I (mistakenly) thought that it would be cleaner to handle auto-continuation entirely in backend. Here's my new reasoning in favor of the
__event_emitter__design.{"type": "status", ..., "done": false}to let users understand that the system is working even though they didn't type any new messages yet.Implementation note: If several different scripts each try to trigger a continuation in the same conversation cycle, those should probably be de-duplicated / considered idempotent. An alternate message design like
{"type": "automatically_continue_this_message", "enabled": true}might make this clearer (i.e. setting it to true many times in a row only triggers one continuation).@tjbck commented on GitHub (Aug 15, 2024):
Added to dev, here's how you would use this:
Let me know if you encounter any issues!