mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[GH-ISSUE #8168] Issue with __event_emitter__ and Content Persistence in Custom Functions Using Predefined outlet Method
#30554
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 @cr-zhichen on GitHub (Dec 28, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8168
Originally assigned to: @tjbck on GitHub.
Bug Report
Installation Method
I installed Open WebUI using
docker-compose.Environment
Expected Behavior:
__event_emitter__parameter passed to theoutletmethod should work as expected, allowing events to be emitted successfully.body["messages"][-1]["content"]in theoutletmethod of a custom function, the changes should persist, and the front-end should display the updated content without reverting to the model's original output.Actual Behavior:
__event_emitter__parameter in theoutletmethod does not function as intended, preventing events from being emitted.body["messages"][-1]["content"]is modified in theoutletmethod, the front-end briefly displays the updated content ("TEST") but then reverts to the model's actual output.Description
The issue occurs when using custom functions within the
outletmethod, which is a predefined function provided by the open-source project. The__event_emitter__parameter fails to emit events, and modifications to thebody["messages"][-1]["content"]field are not persisted in the front-end display.Reproduction Details
outletmethod provided by the open-source project.__event_emitter__parameter to emit events.body["messages"][-1]["content"]field in theoutletmethod.__event_emitter__does not work and the front-end reverts the modified content to the model's output.https://github.com/user-attachments/assets/92828329-5df1-4e3d-9a2d-3a757e5895fc
Example Code
__event_emitter__parameter passed in theoutletmethod cannot be used properly. Below is a reproducible function example.outletmethod, using a statement likebody["messages"][-1]["content"] = "TEST"will cause the front-end page to update the information to "TEST" after the output is completed, but it will instantly switch back to the actual content output by the model. Below is a reproducible function example.@tjbck commented on GitHub (Dec 29, 2024):
Thank you for your detailed issue report! Not many people take the time to provide the necessary details in such a clear and systematic manner, so I truly appreciate your effort. You're an exemplary example of how to report issues effectively. That being said, I wanted to let you know that both issues have been addressed in dev!