mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #8292] Issue with __event_emitter__ for Action functions
#15071
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 @deseven on GitHub (Jan 3, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8292
Originally assigned to: @tjbck on GitHub.
Installation Method
Docker
Environment
Confirmation:
Expected Behavior:
__event_emitter__should work.Actual Behavior:
__event_emitter__doesn't work, producing an exception.Description
Bug Summary:
Seems to be similar to #8168 but this time for Action functions.
Reproduction Details
Use the following test function (created by Albert Wesker on Discord):
When executing it nothing happens on the frontend, here's output from the action:
@tjbck commented on GitHub (Jan 4, 2025):
Might already be resolved in dev, testing wanted here!
@deseven commented on GitHub (Jan 4, 2025):
Seems to be doing something, but I'm not sure if it's the correct behaviour or not. It adds a custom message first, but then removes it.
Logs:
Video (ignore the slowness, I'm running it on a very crappy arm cpu):
https://d7.wtf/s/Recording%20at%202025-01-04%2019.19.40.mp4
@MaximeRivest commented on GitHub (Jan 4, 2025):
on cuda nothing showed up in the status and on dev I had the 3 messages. So its fixed for me. (not sure if I should use cuda or not...)
@deseven commented on GitHub (Jan 5, 2025):
@MaximeRivest what do you mean by "3 messages"? It should change the status twice and append to the assistant's message, unless I'm missing something.
@MaximeRivest commented on GitHub (Jan 5, 2025):
This, sorry my message was not very clear
@deseven commented on GitHub (Jan 5, 2025):
Gotcha, thanks, so what you get is the same. Do you know if it should remove the appended message (message 1) at the last step?
@MaximeRivest commented on GitHub (Jan 5, 2025):
It seems due to
return bodywithout that it stays@deseven commented on GitHub (Jan 5, 2025):
Makes sense :)
Okay, all good then.
@tjbck commented on GitHub (Jan 5, 2025):
for anyone in the future that comes across this, action should almost always return
Noneinstead ofreturn body!@acceleratorlastorder commented on GitHub (Jan 5, 2025):
i'm guessing in the event we want to change the actual content of the body we do have to return it then? if so is there a way to interpolate html or is it not possible at the moment? (one of my guess would be for security reason, but i'm asking in case not)
@tjbck commented on GitHub (Jan 5, 2025):
@acceleratorlastorder you can still use
__event_emitter__for the use case you described! There's nothing particularly wrong with returning body per se, but it's just not the best practice.