bug: __event_emitter__ broken for function outlets #1473

Closed
opened 2025-11-11 14:45:54 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @michaelpoluektov on GitHub (Jul 9, 2024).

Bug Report

Description

The following definitions for __event_emitter__ and __event_call__ make no sense:

https://github.com/open-webui/open-webui/blob/24ef5af2a13caccb917e538f536ba03230dac1d6/backend/main.py#L1180

They expect the user to provide a chat, message and session ID in the payload.

Additionally, neither __event_emitter__ nor __event_call__ are available from the pipe() method of regular pipelines: only filter pipelines work.

__event_emitter__ and __event_call__ should ideally be stored somewhere with the session.

Originally created by @michaelpoluektov on GitHub (Jul 9, 2024). # Bug Report ## Description The following definitions for `__event_emitter__` and `__event_call__` make no sense: https://github.com/open-webui/open-webui/blob/24ef5af2a13caccb917e538f536ba03230dac1d6/backend/main.py#L1180 They expect the user to provide a chat, message and session ID in the payload. Additionally, neither `__event_emitter__` nor `__event_call__` are available from the `pipe()` method of regular pipelines: only filter pipelines work. `__event_emitter__` and `__event_call__` should ideally be stored somewhere with the session.
Author
Owner

@nomppy commented on GitHub (Jul 30, 2024):

Were you able to fix this? I downloaded a function from the functions page (this one), but I'm getting errors that the __event_emitter__ parameter is missing, __model__ is also not being passed to the inlet()

@nomppy commented on GitHub (Jul 30, 2024): Were you able to fix this? I downloaded a function from [the functions page](https://openwebui.com/functions) ([this one](https://openwebui.com/f/hub/autotool_filter)), but I'm getting errors that the `__event_emitter__` parameter is missing, `__model__` is also not being passed to the `inlet()`
Author
Owner

@michaelpoluektov commented on GitHub (Jul 30, 2024):

This was fixed in a PR (I believe merged somewhere around 0.3.8).

I don't know exactly what issue you're facing but assuming you're using the latest version of OWUI I'd try to define your inlets/outlets as:

def outlet(..., __event_emitter__=None):

Then check that __event_emitter__ is not None before calling it.

Might be the inlets/outlets being called to generate titles and whatnot

@michaelpoluektov commented on GitHub (Jul 30, 2024): This was fixed in a PR (I believe merged somewhere around 0.3.8). I don't know exactly what issue you're facing but assuming you're using the latest version of OWUI I'd try to define your inlets/outlets as: ```python def outlet(..., __event_emitter__=None): ``` Then check that `__event_emitter__` is not None before calling it. Might be the inlets/outlets being called to generate titles and whatnot
Author
Owner

@nomppy commented on GitHub (Jul 30, 2024):

I don't know exactly what issue you're facing but assuming you're using the latest version of OWUI I'd try to define your inlets/outlets as:

I'm silly, I wasn't on the latest version. Building the new image now, thanks for your help!

@nomppy commented on GitHub (Jul 30, 2024): > I don't know exactly what issue you're facing but assuming you're using the latest version of OWUI I'd try to define your inlets/outlets as: I'm silly, I wasn't on the latest version. Building the new image now, thanks for your help!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#1473